Creates variations of a given image. DALL-E 2 only.
Method
client.images.createVariation(params)
Request Parameters
The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
The model to use for image variation generation. Currently only openai/dall-e-2 is supported.
The number of images to generate. Must be between 1 and 10.Default: 1
The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.Default: 1024x1024
The format in which the generated images are returned:
url - URLs valid for 60 minutes
b64_json - Base64-encoded JSON
Default: url
A unique identifier representing your end-user, which can help OpenAI monitor and detect abuse.
Response
Unix timestamp when images were created.
List of generated images.
URL of the generated image (if response_format=url).
Base64-encoded image data (if response_format=b64_json).
Examples
import fs from "fs";
const variation = await client.images.createVariation({
image: fs.createReadStream("original.png"),
model: "openai/dall-e-2"
});
console.log(variation.data[0].url);