Dalle-E 3
POST
https://api.cometapi.com/v1/images/generationsGiven a prompt and/or an input image, the model will generate a new image.
Functions Offered for DALL·E Image Generation
Creating Images from Scratch
- Supported Models: DALL·E 3 and DALL·E 2
- Description: Generates new images based on a text prompt.
Creating Edited Versions of Images
- Supported Model: DALL·E 2
- Description: Replaces areas of a pre-existing image based on a new text prompt.
Creating Variations of an Existing Image
- Supported Model: DALL·E 2
- Description: Generates variations of an existing image.
Available Sizes
- 1792x1024 (DALL·E 3 only)
- 1024x1792 (DALL·E 3 only)
- 1024x1024 (DALL·E 2, DALL·E 3)
- 512x512 (DALL·E 2 only)
- 256x256 (DALL·E 2 only)
Request
Your API-KEY or Token
The model to use for image generation. Defaults to dall-e-2
A text description of the desired image(s). The maximum length is 1000 characters for dall-e-2 and 4000 characters for dall-e-3
The number of images to generate. Must be between 1 and 10. For dall-e-3, only n=1 is supported.
The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024 for dall-e-2. Must be one of 1024x1024, 1792x1024, or 1024x1792 for dall-e-3 models. Defaults to 1024x1024
The quality of the image that will be generated. hd creates images with finer details and greater consistency across the image. This param is only supported for dall-e-3. Defaults to standard.
The format in which the generated images are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated. Defaults to url.
The style of the generated images. Must be one of vivid or natural. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for dall-e-3. Defaults to vivid.
{
"prompt": "A colorful sunset over the mountains",
"n": 1,
"model": "dall-e-3",
"size": "1024x1024"
}
Request samples
[api.label.responses]
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "https://your_generated_image.jpg"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
}