edit-workflow

Replace background with Ideogram 4.5

Changed on

Rebuild the background of an image as the setting shown in a background_reference image, with Ideogram 4.5 at its highest quality. The people in the source image are kept, people in the reference are left out, and results keep the source image's aspect ratio. Returns a generation_id; poll GET /v2/generations/{generation_id} or supply a webhook_url.

post/v2/image/replace-background/ideogram-4-5

Request

  • Base URL: (relative, and it does not resolve against the document’s source URL)
  • URL: /v2/image/replace-background/ideogram-4-5
  • Auth: one of:
    • API key in header Api-Key
    • HTTP bearer

Query parameters

dry_runboolean

When true, the request is validated and priced but not run: nothing is generated, stored, or billed, and no safety review is performed. The response is a PriceQuote object instead of the usual response for this endpoint. Send exactly the request you would send to generate, so the quote reflects the same options.

Request body

imagestring binary

The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and MPO are supported, up to 50 MB. Its longer side may be at most the model's maximum aspect ratio times its shorter side; a more extreme proportion is rejected with a 400 that states the allowed range. Multipart requests only.

background_referencestring binary

A photo of the setting the new background should match. Its people are not copied. It is held to the same aspect-ratio limit as image. Multipart requests only.

num_imagesinteger

The number of images to generate.

privateboolean

Whether to keep the result private. When omitted, the result is private. 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"
  },
  "background_reference_asset_identifier": {
    "asset_type": "RESPONSE",
    "asset_id": "7uS_VESkRI6O3-sVgHQp_A"
  },
  "webhook_url": "https://api.example.com/webhooks/ideogram"
}

Response

Background replacement accepted for asynchronous processing.

generation_idstring required

The generation ID to poll with GET /v2/generations/{generation_id}.

Example response

{
  "generation_id": "generation_id"
}

Changes