images-inpaint

Repaint a masked region with a custom Ideogram 3.0 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}.

post/v2/image/inpaint/ideogram-3-custom-model

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

promptstring required

The prompt describing the repainted result.

custom_model_uristring 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.

imagestring 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.

maskstring 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_imagesinteger

The number of images to generate.

seedinteger

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_codesStyleCode[]

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_idstring

A saved style, by its URL-safe base64 collection id. Takes priority over asset identifiers and raw style reference images.

style_reference_collection_version_idstring

Optional URL-safe base64 version id for the saved style. Ignored without style_reference_collection_id.

style_reference_imagesstring[]

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_detectionboolean nullable

Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return is_image_safe: false.

asyncboolean

When false, block until the images are ready. When true, return after dispatch and poll GET /v1/generations/{generation_id}.

privateboolean 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_idstring

A collection you can write to, by its URL-safe base64 collection id. Completed images are added to it.

Example request

{
  "custom_model_uri": "model/my-custom-model/version/1",
  "image_asset_identifier": {
    "asset_type": "RESPONSE",
    "asset_id": "7uS_VESkRI6O3-sVgHQp_A"
  },
  "mask_asset_identifier": {
    "asset_type": "RESPONSE",
    "asset_id": "7uS_VESkRI6O3-sVgHQp_A"
  },
  "magic_prompt": "on",
  "seed": 12345,
  "style_preset": "bright_art",
  "style_codes": [
    "AAFF5733",
    "0133FF57",
    "DE3357FF"
  ],
  "style_reference_asset_identifiers": [
    {
      "asset_type": "RESPONSE",
      "asset_id": "7uS_VESkRI6O3-sVgHQp_A"
    }
  ]
}

Response

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

generation_idstring required

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

seedinteger required

Random seed. Set for reproducible generation.

widthinteger required

The output width in pixels.

heightinteger required

The output height in pixels.

Example response

{
  "data": [
    {
      "seed": 12345,
      "prompt": "prompt",
      "resolution": "1024x1024",
      "url": "https://openapi-generator.tech",
      "is_image_safe": true
    },
    {
      "seed": 12345,
      "prompt": "prompt",
      "resolution": "1024x1024",
      "url": "https://openapi-generator.tech",
      "is_image_safe": true
    }
  ],
  "seed": 12345,
  "generation_id": "generation_id",
  "width": 0,
  "height": 6
}

Changes

Changed in 2 of the 34 revisions of this API.1049

  • 4e95197be44a1048See the full diff
    • ▲

      added to the request property allOf list (media type: multipart/form-data)

      request-property-all-of-added

    • ▲

      added to the request property allOf list (media type: application/json)

      request-property-all-of-added

    • ▲

      added to the request property allOf list (media type: multipart/form-data)

      request-property-all-of-added

    • ▲

      added to the request property allOf list (media type: application/json)

      request-property-all-of-added

    • ▲

      removed the enum value DEFAULT of the request property (media type: multipart/form-data)

      request-property-enum-value-removed

    • ▲

      removed the enum value DEFAULT of the request property (media type: application/json)

      request-property-enum-value-removed

    • ▲

      removed the enum value QUALITY of the request property (media type: multipart/form-data)

      request-property-enum-value-removed

    • ▲

      removed the enum value QUALITY of the request property (media type: application/json)

      request-property-enum-value-removed

    • ▲

      removed the enum value TURBO of the request property (media type: multipart/form-data)

      request-property-enum-value-removed

    • ▲

      removed the enum value TURBO of the request property (media type: application/json)

      request-property-enum-value-removed

    • ●

      removed from the request property allOf list (media type: multipart/form-data)

      request-property-all-of-removed

    • ●

      removed from the request property allOf list (media type: application/json)

      request-property-all-of-removed

    • ●

      removed from the request property allOf list (media type: multipart/form-data)

      request-property-all-of-removed

    • ●

      removed from the request property allOf list (media type: application/json)

      request-property-all-of-removed

    • ○

      the request property default value changed from AUTO to auto (media type: multipart/form-data)

      request-property-default-value-changed

    • ○

      the request property default value changed from AUTO to auto (media type: application/json)

      request-property-default-value-changed

    • ○

      added the new default enum value to the request property (media type: multipart/form-data)

      request-property-enum-value-added

    • ○

      added the new default enum value to the request property (media type: application/json)

      request-property-enum-value-added

    • ○

      added the new quality enum value to the request property (media type: multipart/form-data)

      request-property-enum-value-added

    • ○

      added the new quality enum value to the request property (media type: application/json)

      request-property-enum-value-added

    • ○

      added the new turbo enum value to the request property (media type: multipart/form-data)

      request-property-enum-value-added

    • ○

      added the new turbo enum value to the request property (media type: application/json)

      request-property-enum-value-added

    This revision also has 13 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • ○

      endpoint added

      endpoint-added