---
title: "Repaint a masked region with a consistent character with Ideogram 3.0"
method: POST
path: "/v2/images/inpaint/ideogram-v3-character"
tags: ["images-inpaint"]
---

# Repaint a masked region with a consistent character with Ideogram 3.0

`POST /v2/images/inpaint/ideogram-v3-character`

Repaint the masked region of a source image so it features a
consistent character, with Ideogram 3.0. For each of the source image
and the mask, supply either an `AssetIdentifier` reference
(`image_asset_identifier` / `mask_asset_identifier`) or the raw image
bytes directly (`image` / `mask`, multipart requests only). If both a
reference and bytes are supplied for the same input, the reference
wins and the bytes are ignored.

Supply the character as a saved character
(`character_reference_collection_id`), as
`character_reference_asset_identifiers` references (an image already
stored with Ideogram), or as raw `character_reference_images` bytes
(multipart requests only, with an optional
`character_reference_mask` marking where the character is in the
reference). If more than one form is supplied, the collection wins
over the identifiers, and the identifiers win over the bytes.

The output matches the size of the source image (snapped to the
nearest resolution the model renders). By default the request blocks
until the images are ready and returns them in `data`. Set `async` to
true to return immediately after the request is accepted, then poll
for completion and results with `GET /v1/generations/{generation_id}`
using the returned `generation_id`.

## Request body

- InpaintImageIdeogramV3CharacterRequest — Supply the source image and the mask each as either an `AssetIdentifier` reference or (multipart requests only) raw image bytes; at least one form of each is required. Supply the character as a saved character collection, as asset identifiers, or (multipart requests only) as raw image bytes. Exactly one character is supported per request; when more than one form of an input is given, the stronger form is used as documented on each field.
  - `prompt` string, required — The prompt describing the repainted result.
  - `image_asset_identifier` AssetIdentifier — An identifier for an ideogram asset.
    - `asset_type` 'ASSET' | 'CANVAS_ASSET' | 'LAYERED_ASSET' | 'RESPONSE' | 'UPLOAD', required
    - `asset_id` string, required
  - `image` string, binary — The source image to repaint (max size 25MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported. Multipart requests only; ignored if `image_asset_identifier` is also supplied.
  - `mask_asset_identifier` AssetIdentifier — An identifier for an ideogram asset.
    - `asset_type` 'ASSET' | 'CANVAS_ASSET' | 'LAYERED_ASSET' | 'RESPONSE' | 'UPLOAD', required
    - `asset_id` string, required
  - `mask` string, binary — A black-and-white mask the same size as the source image, as raw bytes. Black marks the region to repaint; only JPEG, PNG, and WEBP formats are supported. Multipart requests only; ignored if `mask_asset_identifier` is also supplied.
  - `character_reference_collection_id` string — A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_asset_identifiers` and `character_reference_images` if more than one is supplied.
  - `character_reference_collection_version_id` string — Optional URL-safe base64 version id pinning a specific version of the `character_reference_collection_id` collection. Ignored without it.
  - `character_reference_asset_identifiers` AssetIdentifier[] — An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied.
    - `asset_type` 'ASSET' | 'CANVAS_ASSET' | 'LAYERED_ASSET' | 'RESPONSE' | 'UPLOAD', required
    - `asset_id` string, required
  - `character_reference_images` string[] — An image to use as the character reference (max size 25MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported. Multipart requests only; ignored if a character collection or asset identifier is also supplied.
  - `character_reference_mask` string, binary — 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_prompt` 'AUTO' | 'ON' | 'OFF' — Determine if MagicPrompt should be used in generating the request or not.
  - `num_images` integer — The number of images to generate.
  - `seed` integer — Random seed. Set for reproducible generation.
  - `rendering_speed` 'TURBO' | 'DEFAULT' | 'QUALITY' — The rendering speed to use.
  - `style_type` 'AUTO' | 'REALISTIC' | 'FICTION' — The style type to repaint the character with. Defaults to `AUTO`.
  - `enable_copyright_detection` boolean, nullable — Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`.
  - `async` boolean — When false (the default), the request blocks 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 /v1/generations/{generation_id}` using the returned `generation_id`.

## Response `200`

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

- InpaintImageIdeogramV3CharacterResponse — Response returned by `POST /v2/images/inpaint/ideogram-v3-character`. Synchronous requests (the default) include the repainted images in `data`. Requests with `async` set to true omit `data`; poll for completion and results with `GET /v1/generations/{generation_id}` using the returned `generation_id`. The seed, width, and height report the values the request resolved to when the caller left them unset.
  - `generation_id` string, required — URL-safe base64 ID of the accepted generation. Accepted by the `GET /v1/generations/{generation_id}` polling endpoint.
  - `data` InpaintedImageObject[] — The repainted images, in generation order. Present only for synchronous requests (`async` omitted or false).
    - `url` string, uri, nullable — The direct link to the repainted image. Empty when the image did not pass safety checks.
    - `prompt` string, required — The final prompt the image was generated from.
    - `resolution` string, required — The resolution of the repainted image, formatted as "WIDTHxHEIGHT".
    - `is_image_safe` boolean, required — Whether the image passed safety checks. If false, `url` is empty.
    - `seed` integer, required — Random seed. Set for reproducible generation.
  - `seed` integer, required — Random seed. Set for reproducible generation.
  - `width` integer, required — The output width in pixels this request resolved to.
  - `height` integer, required — The output height in pixels this request resolved to.

## Other responses

- `400` — Invalid input provided.
- `401` — Unauthorized.
- `402` — Insufficient credits or quota.
- `404` — A referenced asset or collection was not found.
- `422` — The prompt did not pass safety checks.
- `429` — Too many requests.
- `500` — Internal server error.
- `503` — The endpoint is temporarily unavailable.

---

[API](https://skmtc.net/ideogram/apis/ideogram-openapi-3-0.md) · [All operations](https://skmtc.net/ideogram/apis/ideogram-openapi-3-0/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ideogram/ideogram-openapi-3-0/revisions/898026c78d68/schema)
