Create image variation
images.create_variation(**kwargs) -> ImagesResponse { created, background, data, 4 more }
POST/images/variations
Creates a variation of a given image. This endpoint only supports dall-e-2.
Parameters
image: FileInput
The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
n: Integer
The number of images to generate. Must be between 1 and 10.
minimum1
maximum10
user: String
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
Returns
Create image variation
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
images_response = openai.images.create_variation(image: Pathname(__FILE__))
puts(images_response){
"created": 1589478378,
"data": [
{
"url": "https://..."
},
{
"url": "https://..."
}
]
}
Returns Examples
{
"created": 1589478378,
"data": [
{
"url": "https://..."
},
{
"url": "https://..."
}
]
}