from pydantic import BaseModel, Field from huggingface_hub import TextToImageTargetSize from typing import List, Optional class TextToImageRequest(BaseModel): prompt: str = Field(..., description="The prompt to generate an image from.") negative_prompt: Optional[List[str]] = Field(None, description="One or several prompts to guide what NOT to include in image generation.") height: Optional[float] = Field(None, description="The height in pixels of the image to generate.") width: Optional[float] = Field(None, description="The width in pixels of the image to generate.") num_inference_steps: Optional[int] = Field(None, description="The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference.") guidance_scale: Optional[float] = Field(None, description="A higher guidance scale value encourages the model to generate images closely linked to the text prompt, but values too high may cause saturation and other artifacts.") model: Optional[str] = Field(None, description="The model to use for inference. Can be a model ID hosted on the Hugging Face Hub or a URL to a deployed Inference Endpoint. If not provided, the default recommended text-to-image model will be used.") scheduler: Optional[str] = Field(None, description="Override the scheduler with a compatible one.") #target_size: Optional[TextToImageTargetSize] = Field(None, description="The size in pixel of the output image") seed: Optional[int] = Field(None, description="Seed for the random number generator.")