Change image
CURRENTLY NOT SUPPORTED
Creates a variation of a given image.
Request
POST
https://ai.api.cloud.yandex.net/v1/images/variations
Body
multipart/form-data
{
"image": "example",
"model": "example",
"n": 1,
"response_format": "url",
"size": "1024x1024",
"user": "example"
}
|
Name |
Description |
|
image |
Type: string<binary> The image to use as the basis for the variation(s). Example: |
|
model |
Any of 1 type
The model to use for image generation. Example: |
|
n |
Type: integer | null The number of images to generate. Must be between 1 and 10. Default: Min value: Max value: |
|
response_format |
Type: string | null The format in which the generated images are returned. Must be one of Default: Enum: |
|
size |
Type: string | null The size of the generated images. Default: Const: Example: |
|
user |
Type: string A unique identifier representing your end-user, which can help AI Studio to monitor and detect abuse. Example: |
Responses
200 OK
OK
Body
application/json
{
"created": 0,
"data": [
{
"b64_json": "example",
"url": "example",
"revised_prompt": "example"
}
],
"background": "transparent",
"output_format": "png",
"size": "1024x1024",
"quality": "low",
"usage": {
"input_tokens": 0,
"total_tokens": 0,
"output_tokens": 0,
"output_tokens_details": {
"image_tokens": 0,
"text_tokens": 0
},
"input_tokens_details": {
"text_tokens": 0,
"image_tokens": 0
}
}
}
|
Name |
Description |
|
created |
Type: integer The Unix timestamp (in seconds) of when the image was created. |
|
background |
Type: string The background parameter used for the image generation. Either Enum: |
|
data |
Type: Image[] The list of generated images. Example
|
|
output_format |
Type: string The output format of the image generation. Either Enum: |
|
quality |
Type: string The quality of the image generated. Either Enum: |
|
size |
Type: string The size of the image generated. Either Enum: |
|
usage |
Type: ImageGenUsage The token usage information for the image generation. Example
|
Image
Represents the content or the URL of a generated image.
|
Name |
Description |
|
b64_json |
Type: string The base64-encoded JSON of the generated image. Example: |
|
revised_prompt |
Type: string CURRENTLY NOT SUPPORTED The revised prompt that was used to generate the image. Example: |
|
url |
Type: string CURRENTLY NOT SUPPORTED The URL of the generated image generated image. Example: |
Example
{
"b64_json": "example",
"url": "example",
"revised_prompt": "example"
}
ImageGenOutputTokensDetails
The output token details for the image generation.
|
Name |
Description |
|
image_tokens |
Type: integer The number of image output tokens generated by the model. |
|
text_tokens |
Type: integer The number of text output tokens generated by the model. |
Example
{
"image_tokens": 0,
"text_tokens": 0
}
ImageGenInputUsageDetails
The input tokens detailed information for the image generation.
|
Name |
Description |
|
image_tokens |
Type: integer The number of image tokens in the input prompt. |
|
text_tokens |
Type: integer The number of text tokens in the input prompt. |
Example
{
"text_tokens": 0,
"image_tokens": 0
}
ImageGenUsage
The token usage information for the image generation.
|
Name |
Description |
|
input_tokens |
Type: integer The number of tokens (images and text) in the input prompt. |
|
input_tokens_details |
Type: ImageGenInputUsageDetails The input tokens detailed information for the image generation. Example
|
|
output_tokens |
Type: integer The number of output tokens generated by the model. |
|
total_tokens |
Type: integer The total number of tokens (images and text) used for the image generation. |
|
output_tokens_details |
Type: ImageGenOutputTokensDetails The output token details for the image generation. Example
|
Example
{
"input_tokens": 0,
"total_tokens": 0,
"output_tokens": 0,
"output_tokens_details": {
"image_tokens": 0,
"text_tokens": 0
},
"input_tokens_details": {
"text_tokens": 0,
"image_tokens": 0
}
}