Skip to navigation

Remove an object

Remove a masked object from an image. Upload the source image and a mask of the same size using multipart/form-data. Returns a generation_id; poll GET /v2/generations/{generation_id} for the result.

Authentication

Api-Keystring

API key for access control. Use in the header with the name "Api-Key"

Query parameters

dry_runbooleanOptionalDefaults to false

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

The source image and mask, uploaded using multipart/form-data.

imagefileRequired
The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only.
maskfileRequired

A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only.

seedintegerOptional0-2147483647
Random seed. Set for reproducible generation.

Response

Object removal request accepted; poll for completion with GET /v2/generations/{generation_id}.

generation_idstring

URL-safe base64 ID of the accepted generation. Accepted by the GET /v2/generations/{generation_id} polling endpoint.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
413
Content Too Large Error
429
Too Many Requests Error
503
Service Unavailable Error