latestOpenAPI 3.0.22026-08-21134292561.4 KB

898026c78d68

edit-workflow

Change a product's color while preserving everything else

Recolors the masked region of the product photo to the target color while preserving the product's geometry, materials, prints, logos, and shading, and keeping every region outside the mask unchanged.

The request is processed asynchronously. Poll GET /v1/generations/{generation_id} with the returned generation_id until the generation is completed or failed.

Supply the product photo as either an AssetIdentifier reference (image_asset_identifier) or the raw image bytes directly (image, multipart requests only). Provide exactly one of the two forms; supplying both, or neither, is rejected with a 400.

Supply the mask marking the region to recolor as either an AssetIdentifier reference (mask_asset_identifier) or the raw mask bytes directly (mask, multipart requests only). Provide exactly one of the two forms. The mask must have the same pixel dimensions as the product photo; white (or opaque) pixels mark the region to recolor.

post/v2/workflow/colorways

Request body

imagestring binary

The product photo to recolor (max size 25MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported. Multipart requests only. Provide exactly one of image_asset_identifier or image.

maskstring binary

The mask marking the region of the product photo to recolor (max size 25MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported. The mask must have the same pixel dimensions as the product photo; white (or opaque) pixels mark the region to recolor. Multipart requests only. Provide exactly one of mask_asset_identifier or mask.

colorstring required

The target color for the masked region, as a six-digit hex code like #B3202C. The product's shape, construction, materials, prints, and logos are always preserved.

aspect_ratiostring

The aspect ratio of the generated image. Defaults to the aspect ratio of the product photo when omitted, which preserves the original framing exactly. When a different ratio is requested, the scene is extended to fill the new shape rather than cropped, so part of the frame is newly generated. Supported values are 1:1, 3:4, 4:3, 16:9, and 9:16.

quality'VERY_LOW' | 'LOW' | 'MEDIUM' | 'HIGH'

The generation quality level. Higher levels may use more inference steps or additional prompt processing.

privateboolean

If true, the user is requesting private generation. If omitted, this defaults to the user's plan entitlement. Enterprise generations are always private.

webhook_urlstring uri

HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a JSON POST to this URL once all images for the request have finished generating. The body mirrors the synchronous generate response: request_id, created, and a data array containing every generated image (url, prompt, resolution, seed, is_image_safe). Each delivery is signed with Ed25519 and verifiable against the public keys at https://api.ideogram.ai/v1/.well-known/jwks.json. Must be HTTPS; private and loopback hosts and the cloud metadata service are rejected.

Example request

{
  "image_asset_identifier": {
    "asset_type": "RESPONSE",
    "asset_id": "7uS_VESkRI6O3-sVgHQp_A"
  },
  "mask_asset_identifier": {
    "asset_type": "RESPONSE",
    "asset_id": "7uS_VESkRI6O3-sVgHQp_A"
  },
  "webhook_url": "https://api.example.com/webhooks/ideogram"
}

Response

Colorway accepted for asynchronous processing.

generation_idstring required

URL-safe base64 ID accepted by the generation polling endpoint.

Example response

{
  "generation_id": "generation_id"
}