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

# Repaint a masked region with a custom Ideogram 3.0 model

`POST /v2/images/inpaint/ideogram-v3-custom-model`

Repaint the masked region of a source image with a custom Ideogram 3.0
model the authenticated user or organization can access. Supply the
model URI returned by the custom-model API as `custom_model_uri`.

For each of the source image and mask, supply either an
`AssetIdentifier` reference (`image_asset_identifier` /
`mask_asset_identifier`) or raw bytes (`image` / `mask`, multipart
requests only). A reference wins if both forms are supplied.

Optional style controls are style codes, a style preset, or style
reference images. Supply style references as a saved style, existing
asset identifiers, or raw image bytes. Only one style control may be
used; when multiple reference forms are supplied, the collection wins
over identifiers, and identifiers win over bytes.

By default the request blocks until the images are ready. Set `async`
to true to return after dispatch and poll
`GET /v1/generations/{generation_id}`.

## Request body

- InpaintImageIdeogramV3CustomModelRequest — Supply the source image and mask as either `AssetIdentifier` references or raw bytes. At least one form of each input is required; references take priority over bytes when both are supplied.
  - `prompt` string, required — The prompt describing the repainted result.
  - `custom_model_uri` string, required — 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.
  - `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 JPEG, PNG, or WEBP bytes. Multipart requests only; ignored when `image_asset_identifier` is 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 JPEG, PNG, or WEBP bytes. Black marks the region to repaint. Multipart requests only; ignored when `mask_asset_identifier` is supplied.
  - `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. When omitted, the server chooses a speed supported by the selected custom model.
  - `style_preset` '80S_ILLUSTRATION' | '90S_NOSTALGIA' | 'ABSTRACT_ORGANIC' | 'ANALOG_NOSTALGIA' | 'ART_BRUT' | 'ART_DECO' | 'ART_POSTER' | 'AURA' | 'AVANT_GARDE' | 'BAUHAUS' | 'BLUEPRINT' | 'BLURRY_MOTION' | 'BRIGHT_ART' | 'C4D_CARTOON' | 'CHILDRENS_BOOK' | 'COLLAGE' | 'COLORING_BOOK_I' | 'COLORING_BOOK_II' | 'CUBISM' | 'DARK_AURA' | 'DOODLE' | 'DOUBLE_EXPOSURE' | 'DRAMATIC_CINEMA' | 'EDITORIAL' | 'EMOTIONAL_MINIMAL' | 'ETHEREAL_PARTY' | 'EXPIRED_FILM' | 'FLAT_ART' | 'FLAT_VECTOR' | 'FOREST_REVERIE' | 'GEO_MINIMALIST' | 'GLASS_PRISM' | 'GOLDEN_HOUR' | 'GRAFFITI_I' | 'GRAFFITI_II' | 'HALFTONE_PRINT' | 'HIGH_CONTRAST' | 'HIPPIE_ERA' | 'ICONIC' | 'JAPANDI_FUSION' | 'JAZZY' | 'LONG_EXPOSURE' | 'MAGAZINE_EDITORIAL' | 'MINIMAL_ILLUSTRATION' | 'MIXED_MEDIA' | 'MONOCHROME' | 'NIGHTLIFE' | 'OIL_PAINTING' | 'OLD_CARTOONS' | 'PAINT_GESTURE' | 'POP_ART' | 'RETRO_ETCHING' | 'RIVIERA_POP' | 'SPOTLIGHT_80S' | 'STYLIZED_RED' | 'SURREAL_COLLAGE' | 'TRAVEL_POSTER' | 'VINTAGE_GEO' | 'VINTAGE_POSTER' | 'WATERCOLOR' | 'WEIRD' | 'WOODBLOCK_PRINT' — A predefined style preset that applies a specific artistic style to the generated image.
  - `style_codes` StyleCode[] — 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_collection_id` string — A saved style, by its URL-safe base64 collection id. Takes priority over asset identifiers and raw style reference images.
  - `style_reference_collection_version_id` string — Optional URL-safe base64 version id for the saved style. Ignored without `style_reference_collection_id`.
  - `style_reference_asset_identifiers` AssetIdentifier[] — Existing upload or generated image assets to use as style references. Takes priority over raw style reference images.
    - `asset_type` 'ASSET' | 'CANVAS_ASSET' | 'LAYERED_ASSET' | 'RESPONSE' | 'UPLOAD', required
    - `asset_id` string, required
  - `style_reference_images` string[] — Images to use as style references (max 10, max size 25MB each), as JPEG, PNG, or WEBP bytes. Multipart requests only; ignored if a collection or asset identifiers are supplied.
  - `enable_copyright_detection` boolean, nullable — Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return `is_image_safe: false`.
  - `async` boolean — When false, block until the images are ready. When true, return after dispatch and poll `GET /v1/generations/{generation_id}`.
  - `private` boolean, nullable — When true or omitted, the output is kept private to your account. Set to false to publish it. Enterprise accounts always generate privately.
  - `target_collection_id` string — A collection you can write to, by its URL-safe base64 collection id. Completed images are added to it.

## Response `200`

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

- InpaintImageIdeogramV3CustomModelResponse — Response returned by `POST /v2/images/inpaint/ideogram-v3-custom-model`. Synchronous requests include the repainted images in `data`; asynchronous requests omit `data` and can be polled with `GET /v1/generations/{generation_id}`.
  - `generation_id` string, required — URL-safe base64 ID accepted by the generation polling endpoint.
  - `data` InpaintedImageObject[] — The repainted images, in generation order. Present only for synchronous requests.
    - `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.
  - `height` integer, required — The output height in pixels.

## Other responses

- `400` — Invalid input provided.
- `401` — Unauthorized.
- `402` — Insufficient credits or quota.
- `403` — The caller cannot use the requested custom model.
- `404` — A referenced asset or style 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.

## Changes

- **2026-09-02** `1429d75daa36` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/ideogram/apis/ideogram-openapi-3-0/changes/v2/images/inpaint/ideogram-v3-custom-model/post.md)

---

[API](https://skmtc.dev/ideogram/apis/ideogram-openapi-3-0.md) · [All operations](https://skmtc.dev/ideogram/apis/ideogram-openapi-3-0/llms.txt) · [OpenAPI document](https://skmtc.dev/ideogram/apis/ideogram-openapi-3-0/revisions/5dc75f5e8df3?raw)
