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 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 masks marking the regions to re-material as either AssetIdentifier references (mask_asset_identifiers) or the raw mask bytes directly (masks, multipart requests only) — up to 4 regions; a single-region edit is a one-item list. Provide exactly one of the two forms. 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.
Supply the material references as either AssetIdentifier references (material_asset_identifiers) or the raw image bytes directly (materials, multipart requests only). Provide exactly one of the two forms. Send either one material, which every mask takes, or exactly one material per mask, paired by position.
Request body
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.
Example response
{
"generation_id": "generation_id"
}