DalleImageGenerator

DalleImageGenerator(
    llm_config: dict[str, Any],
    resolution: Literal['256x256', '512x512', '1024x1024', '1792x1024', '1024x1792'] = '1024x1024',
    quality: Literal['standard', 'hd'] = 'standard',
    num_images: int = 1
)

Generates images using OpenAI’s DALL-E models.
This class provides a convenient interface for generating images based on textual prompts using OpenAI’s DALL-E models. It allows you to specify the DALL-E model, resolution, quality, and the number of images to generate.
Note: Current implementation does not allow you to edit a previously existing image.

Parameters:
NameDescription
llm_configType: dict[str, typing.Any]
resolutionType: Literal[‘256x256’, ‘512x512’, ‘1024x1024’, ‘1792x1024’, ‘1024x1792’]

Default: ‘1024x1024’
qualityType: Literal[‘standard’, ‘hd’]

Default: ‘standard’
num_imagesType: int

Default: 1

Instance Methods

cache_key

cache_key(self, prompt: str) -> str
Parameters:
NameDescription
promptType: str

generate_image

generate_image(self, prompt: str) -> Image
Parameters:
NameDescription
promptType: str