edit-workflow

Product Material Change

Re-renders the masked regions of the product photo in the materials shown by the reference images — matching each one's color, texture, pattern scale, and orientation — while preserving the product's silhouette, construction, seams, and shading, and keeping every region outside the masks 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, the masks marking the regions to re-material, and the material reference images as raw bytes (image, masks, and materials) via multipart/form-data — up to 4 masks; a single-region edit is a one-item list. Every mask must have the same pixel dimensions as the product photo. White pixels mark the region to change; black pixels are preserved. Alpha-only masks are also supported: opaque pixels mark the region to change and transparent pixels are preserved. Send either one material, which every mask takes, or exactly one material per mask, paired by position.

post/v2/tool/material-swap

Request body

imagestring binary

The product photo to edit (max size 25MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported.

masksstring[]

The masks marking the regions of the product photo to change (max 4, max size 25MB each), as raw bytes; only JPEG, PNG, and WEBP formats are supported. Every mask must have the same pixel dimensions as the product photo. White pixels mark the region to change; black pixels are preserved. Alpha-only masks are also supported: opaque pixels mark the region to change and transparent pixels are preserved.

materialsstring[]

The material reference images (max size 25MB each), as raw bytes; only JPEG, PNG, and WEBP formats are supported. Only their material — color, texture, pattern scale, and orientation — is applied to the masked regions. Send one material, which every mask takes, or exactly one per mask paired by position.

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'LOW' | 'MEDIUM' | 'HIGH'

The quality tier for the image edit. Higher tiers may improve detail and take longer to complete.

privateboolean

When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.

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_identifiers": [
    {
      "asset_type": "RESPONSE",
      "asset_id": "7uS_VESkRI6O3-sVgHQp_A"
    }
  ],
  "material_asset_identifiers": [
    {
      "asset_type": "RESPONSE",
      "asset_id": "7uS_VESkRI6O3-sVgHQp_A"
    }
  ],
  "webhook_url": "https://api.example.com/webhooks/ideogram"
}

Response

Material swap accepted for asynchronous processing.

generation_idstring required

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

Example response

{
  "generation_id": "generation_id"
}

Changes