xinference.client.handlers.ImageModelHandle.text_to_image#
- ImageModelHandle.text_to_image(prompt: str, n: int = 1, size: str = '1024*1024', response_format: str = 'url', **kwargs) ImageList #
Creates an image by the input text.
- Parameters:
prompt (str or List[str]) – The prompt or prompts to guide image generation. If not defined, you need to pass prompt_embeds.
n (int, defaults to 1) – The number of images to generate per prompt. Must be between 1 and 10.
size (str, defaults to 1024*1024) – The width*height in pixels of the generated image. Must be one of 256x256, 512x512, or 1024x1024.
response_format (str, defaults to url) – The format in which the generated images are returned. Must be one of url or b64_json.
- Returns:
A list of image objects.
- Return type:
ImageList