Overview
Generate images from text prompts using DALL-E and other image generation models.Python Usage
Basic Image Generation
DALL-E 2 (Faster, Lower Cost)
Save Image to File
Async Usage
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt | str | Required | Image description |
model | str | ”dall-e-3” | Model to use |
n | int | 1 | Number of images |
size | str | ”1024x1024” | Image size |
quality | str | ”standard" | "standard” or “hd” (DALL-E 3 only) |
style | str | None | ”vivid” or “natural” (DALL-E 3 only) |
response_format | str | ”url" | "url” or “b64_json” |
timeout | float | 600.0 | Request timeout |
Result Object
TheImageResult object contains:
url: Image URLb64_json: Base64 encoded image (if requested)revised_prompt: DALL-E 3’s revised promptmodel: Model usedsave(path): Method to save image to file

