Overview
Creates a variation of a given image. Requires multipart/form-data content type.
Request Body
The image to use as the basis for the variation. Must be a valid PNG file, less than 4MB, and square.
The model to use for image variations. Currently only dall-e-2 is supported.
The number of images to generate. Must be between 1 and 10.
The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
The format in which the generated images are returned. Must be url or b64_json.
A unique identifier representing your end-user for abuse monitoring.
Response
Unix timestamp of when the images were created.
Array of generated image variations. Each object contains:
url (string): URL of the variation image (if response_format is url)
b64_json (string): Base64-encoded image (if response_format is b64_json)
cURL
Python
JavaScript
Go
PHP
curl -X POST "https://api.lemondata.cc/v1/images/variations" \
-H "Authorization: Bearer sk-your-api-key" \
-F "[email protected] " \
-F "n=2" \
-F "size=1024x1024"
{
"created" : 1706000000 ,
"data" : [
{
"url" : "https://..."
},
{
"url" : "https://..."
}
]
}
Notes
Image variations are only available with DALL-E 2. The model will generate new images that are similar in style and content to the original image.
The image to use as the basis for the variation. Must be a valid PNG file, less than 4MB, and square.
The model to use for image variations. Currently only dall-e-2 is supported.
The number of images to generate. Must be between 1 and 10.
The size of the generated images. Must be one of 256x256 , 512x512 , or 1024x1024 .
The format in which the generated images are returned. Must be url or b64_json .
A unique identifier representing your end-user for abuse monitoring.
Unix timestamp of when the images were created.
Array of generated image variations. Each object contains: url (string): URL of the variation image (if response_format is url ) b64_json (string): Base64-encoded image (if response_format is b64_json )