latestOpenAPI 3.0.22026-08-19125272497.5 KB

73707bc35f34

images-edit

Transform images with Ideogram 4.5 image-to-image, by asset id or by uploaded bytes

Generate a new image conditioned on one or more source images, with an optional prompt to guide the transformation. Supply the sources either as image_asset_identifiers references (images already stored with Ideogram) or as raw images bytes (multipart requests only) — callers are never required to upload assets first. If both are supplied, the references win and the bytes are ignored. The first source is the primary image being transformed; any further sources are additional references.

By default the request blocks until the output image is ready and returns it in data. Set async to true to return immediately after the request is accepted, then poll for completion and results with GET /v1/generations/{generation_id} using the returned generation_id.

post/v2/images/edit/ideogram-4.5

Request body

promptstring

Optional guidance for the transformation. Image-to-image conditions on the source images, so the model can run from the sources alone.

imagesstring[]

The source images to transform (max 5, max size 25MB per image), as raw bytes; only JPEG, PNG, and WEBP formats are supported. Multipart requests only; ignored if image_asset_identifiers is also supplied.

num_imagesinteger

The number of output images to generate.

resolutionstring required

The output resolution, formatted as "WIDTHxHEIGHT", for example "1024x1024" or "1152x768". Required: a source may be a reference-only resolution that is not a valid output, so the output size is never inferred from the sources. Both dimensions must be multiples of 32 and at least 256px, the total size at most 2048x2048 pixels, and the aspect ratio at most 6:1. Pricing is tiered by total pixels: up to 1024x1024 bills as 1K, above that as 2K.

rendering_speed'TURBO' | 'DEFAULT' | 'QUALITY'

The rendering speed to use.

seedinteger

Random seed. Set for reproducible generation.

asyncboolean

When false (the default), the request blocks until the output image is ready and returns it in data. When true, the request returns as soon as it is accepted; poll for completion and results with GET /v1/generations/{generation_id} using the returned generation_id.

Example request

{
  "image_asset_identifiers": [
    {
      "asset_type": "RESPONSE",
      "asset_id": "7uS_VESkRI6O3-sVgHQp_A"
    }
  ],
  "seed": 12345
}

Response

The output image (synchronous requests), or an acknowledgement to poll with GET /v1/generations/{generation_id} (async requests).

generation_idstring required

URL-safe base64 ID of the accepted generation. Accepted by the GET /v1/generations/{generation_id} polling endpoint.

seedinteger required

Random seed. Set for reproducible generation.

widthinteger required

The output width in pixels this request resolved to.

heightinteger required

The output height in pixels this request resolved to.

Example response

{
  "data": [
    {
      "seed": 12345,
      "prompt": "prompt",
      "resolution": "2048x2048",
      "url": "https://openapi-generator.tech",
      "is_image_safe": true
    },
    {
      "seed": 12345,
      "prompt": "prompt",
      "resolution": "2048x2048",
      "url": "https://openapi-generator.tech",
      "is_image_safe": true
    }
  ],
  "seed": 12345,
  "generation_id": "generation_id",
  "width": 0,
  "height": 6
}