Skip to main content
POST
Inpaint an area
Use a completed image as the source. Upload a black-and-white PNG mask with exactly the same dimensions: white marks the region to change and black preserves it. Send its ID in mask_image_id. The defaults are model v1, mode inpaint, and denoise: 1.0. This operation creates one image. A lower denoise value makes a gentler change. A successful request returns HTTP 202 with a jobs array. Save each id, then get the job until it finishes. Read the completed media from result.url and its reusable ID from result.id. Use an Idempotency-Key when submitting work that may be retried.

Authorizations

Authorization
string
header
required

Create an API key in Studio → account menu → API Keys. Keep it on your server.

Headers

Idempotency-Key
string

Use a unique key for each intended creation. Retry the same method, path and JSON with the same key to replay its response for 24 hours after completion. Conflicting requests and unfinished or uncertain outcomes return 409. An uncertain receipt is never automatically rerun.

Required string length: 1 - 128
Pattern: ^[!-~]+$

Path Parameters

id
string<uuid>
required

Source resource ID.

Body

application/json
mask_image_id
string<uuid>
required

Uploaded black-and-white PNG mask: white marks the region to change; black preserves the surrounding area. Must match the selected source dimensions.

model
enum<string>
default:v1

Model for this operation. Account and plan limits apply.

Available options:
v1
resolution
enum<string>
default:standard

Output quality; dimensions depend on the model and aspect ratio.

Available options:
standard,
high
num_images
integer
default:1

Number of outputs. Defaults to 1. Account limits still apply.

Required range: 1 <= x <= 1
Example:

1

seed
integer

Optional seed; it does not guarantee identical results.

prompt
string

What should appear in the masked area.

mode
enum<string>
default:inpaint
Available options:
inpaint,
extend
reference_image_id
string<uuid>

Optional reference, mutually exclusive with reference_asset_id.

reference_asset_id
string<uuid>

Optional reusable reference, mutually exclusive with reference_image_id.

asset_ids
string[]

Additional reusable reference asset IDs. Supported types depend on the operation.

denoise
number
default:1

Strength of the change.

Required range: 0.05 <= x <= 1
Example:

1

style
string

Optional style directions.

speed
string

Optional processing speed; accepted values depend on the operation and model.

Response

Accepted; poll each job.

jobs
object[]
required
Minimum array length: 1