Skip to navigation

Inpaint a consistent character with Ideogram 3.0

Repaint the masked region of a source image with Ideogram 3.0 so it features a consistent character. Upload the source image, its mask, and a character_reference_images image (or use a saved character) using multipart/form-data. Returns results directly by default; set async or supply a webhook_url to get a generation_id and poll GET /v2/generations/{generation_id}.

Authentication

Api-Keystring

API key for access control. Use in the header with the name "Api-Key"

Query parameters

dry_runbooleanOptionalDefaults to false

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

Use multipart/form-data to upload the source image, its mask, and any character_reference_images or style_reference_images.

promptstringRequired1-10000 characters
The prompt describing the repainted result.
imagefileRequired

The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution.

maskfileRequired

A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only.

character_reference_imagesfilesRequired

An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported.

character_reference_maskfileOptional

Optional grayscale mask for the uploaded character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; applies only with character_reference_images.

magic_promptenumOptionalDefaults to auto

Controls magic prompt (automatic prompt rewriting). Defaults to auto.

Allowed values:
num_imagesintegerOptional1-8Defaults to 1
The number of images to generate.
seedintegerOptional0-2147483647
Random seed. Set for reproducible generation.
rendering_speedenumOptionalDefaults to default
The rendering speed to use.
Allowed values:
style_typeenumOptionalDefaults to auto

The style type to repaint the character with. Defaults to auto. realistic and fiction are supported for character-only requests; style codes or style references (not both) require auto. For API-key callers, combining a style with a character requires that feature to be enabled for their account.

Allowed values:
style_codeslist of stringsOptional

A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.

style_reference_imagesfilesOptional

Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Cannot be combined with style_codes.

asyncbooleanOptionalDefaults to false

When false (the default), the request waits until the repainted images are ready and returns them in data. When true, the request returns as soon as it is accepted; poll for completion and results with GET /v2/generations/{generation_id} using the returned generation_id.

webhook_urlstringOptionalformat: "uri"<=2048 characters

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.

Response

The repainted images (synchronous requests), or an acknowledgement to poll with GET /v2/generations/{generation_id} (async requests).

generation_idstring

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

seedinteger0-2147483647
Random seed. Set for reproducible generation.
widthinteger
The output width in pixels this request resolved to.
heightinteger
The output height in pixels this request resolved to.
datalist of objectsOptional

The repainted images, in generation order. Present only for synchronous requests (async omitted or false).

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error