---
title: "Erase an object from an image"
method: POST
path: "/v1/flux-tools/erase-v1"
tags: ["Models"]
---

# Erase an object from an image

`POST /v1/flux-tools/erase-v1`

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

## Request body

- Flux2EraseInputs — Input model for public FLUX.2 erase.
  - `image` string, required — Base64-encoded input image or HTTP(S) image URL.
  - `mask` string, 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_pixels` integer — Number of pixels to dilate the mask by before removal. Dilation helps cover object edges. Maximum is 25 pixels.
  - `seed` integer, nullable — Optional seed for reproducibility.
  - `safety_tolerance` integer — Tolerance level for input and output moderation. Between 0 and 5, 0 being most strict, 5 being least strict.
  - `output_format` 'jpeg' | 'png' | 'webp'
  - `webhook_url` string, uri, nullable — URL to receive webhook notifications
  - `webhook_secret` string, nullable — Optional secret for webhook signature verification

## Response `200`

Successful Response

- union
  - AsyncResponse
    - `id` string, required
    - `polling_url` string, required
    - `cost` number, nullable — Cost in credits for this request
    - `input_mp` number, nullable — Input megapixels (2 decimal places)
    - `output_mp` number, nullable — Output megapixels (2 decimal places)
  - AsyncWebhookResponse
    - `id` string, required
    - `status` string, required
    - `webhook_url` string, required
    - `cost` number, nullable — Cost in credits for this request
    - `input_mp` number, nullable — Input megapixels (2 decimal places)
    - `output_mp` number, nullable — Output megapixels (2 decimal places)

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/bfl/apis/bfl-api.md) · [All operations](https://skmtc.net/bfl/apis/bfl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bfl/bfl-api/versions/9557482e34b0/schema)
