Skip to main content
POST
Edit a masked region (existing API)
This is a legacy endpoint for existing integrations. New integrations should use the public v1 API. For existing integrations. Use the inpaint guide for new work. Existing response formats and version handling →

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string<uuid>
required

Image or asset ID from a previous response. 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.

resolution
enum<string>
required

Output quality. Send explicitly. Pixel dimensions depend on the image model.

Available options:
standard,
high
Example:

"standard"

denoise
number
required

Strength of the change. Send explicitly.

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

0.75

version_id
string<uuid>

Optional selection from an existing Studio image history. When chaining completed API results, use result.id from the v1 job response as the source image and omit this field.

prompt
string

What should appear in the masked area.

num_images
integer
default:1

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

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

1

model
enum<string>
default:v1

Inpaint currently supports v1.

Available options:
v1
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.

style
string

Optional style directions.

seed
integer

Optional seed; it does not guarantee identical results.

speed
string

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

task
string

Processing task override. Omit for a standard inpaint operation.

Response

Returns the parent image with a new version. The original may already be completed. Track the new version id and poll its source_image_id for the operation’s result.

id
string<uuid>
required

Resource ID.

status
enum<string>
required

Job state. Only completed has a finished result.

Available options:
pending,
generating,
completed,
failed,
policy_blocked,
nsfw_filtered
path
string | null

Result URL. Can be null while the job is pending.

watermarked_path
string | null
width_px
integer | null
height_px
integer | null
size_bytes
integer | null
extension
string | null
is_generated
boolean
for_training
boolean

Whether the upload is a reusable asset reference.

task
string | null

Operation that created this job.

type
string | null
created_timestamp
string<date-time>
finish_timestamp
string<date-time> | null
fail_reason
string | null

Human-readable failure detail.

failure_code
enum<string> | null

Machine-readable failure category, when available.

Available options:
input_rejected,
provider_unavailable,
queue_timeout,
policy_blocked
asset_ids
string<uuid>[] | null

Linked reusable assets.

Resource ID.

versions
object[]

Related versions. May be omitted or empty. Never infer a new version is completed from the parent status.