Skip to navigation

Inpaint with a custom Ideogram 3.0 model

Repaint the masked region of a source image with a custom Ideogram 3.0 model, passed as custom_model_uri. Upload the source image and its mask using multipart/form-data. Returns results directly by default; set async 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 style_reference_images.

promptstringRequired1-10000 characters
The prompt describing the repainted result.
custom_model_uristringRequiredformat: "^model/[^/]+/version/[^/]+$"1-512 characters

The custom model URI returned by the custom-model API, in the form model/<model_name>/version/<version_name>. The authenticated user or organization must have access to the model.

imagefileRequired

The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only.

maskfileRequired

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

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_speedenumOptional
The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model.
Allowed values:
style_presetenumOptional
A predefined style preset. Cannot be combined with style codes or style references.
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), as JPEG, PNG, or WEBP.

asyncbooleanOptionalDefaults to false

When false, wait until the images are ready. When true, return as soon as the request is accepted and poll GET /v2/generations/{generation_id}.

Response

The repainted images, or an acknowledgement for an asynchronous request.
generation_idstring

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

seedinteger0-2147483647
Random seed. Set for reproducible generation.
widthinteger
The output width in pixels.
heightinteger
The output height in pixels.
datalist of objectsOptional
The repainted images, in generation order. Present only for synchronous requests.

Errors

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