Models

Erase an object from an image

Changed on

Submits an erase task using an input image and a mask identifying the object or region to remove.

post/v1/flux-tools/erase-v1

Request

Request body

userstring nullable

Opaque identifier for the end user supplied by the calling platform.

imagestring required

Base64-encoded input image or HTTP(S) image URL.

maskstring required

Base64-encoded black/white mask or HTTP(S) image URL. White pixels indicate the object to remove; black pixels are preserved. Must have the same dimensions as the input image.

dilate_pixelsinteger

Number of pixels to dilate the mask by before removal. Dilation helps cover object edges. Maximum is 25 pixels.

seedinteger nullable

Optional seed for reproducibility.

safety_toleranceinteger

Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.

output_format'jpeg' | 'png' | 'webp'
webhook_urlstring uri nullable

URL to receive webhook notifications

webhook_secretstring nullable

Optional secret for webhook signature verification

Example request

{
  "seed": 42
}

Response

Successful Response

OR

Changes