Skip to main content
POST
/
v1
/
flux-tools
/
erase-v1
Erase an object from an image
curl --request POST \
  --url https://api.bfl.ai/v1/flux-tools/erase-v1 \
  --header 'Content-Type: application/json' \
  --header 'x-key: <api-key>' \
  --data '
{
  "image": "<string>",
  "mask": "<string>",
  "dilate_pixels": 10,
  "seed": 42,
  "safety_tolerance": 2,
  "output_format": "png",
  "webhook_url": "<string>",
  "webhook_secret": "<string>"
}
'
{
  "id": "<string>",
  "polling_url": "<string>",
  "cost": 123,
  "input_mp": 123,
  "output_mp": 123
}

Documentation Index

Fetch the complete documentation index at: https://docs.bfl.ml/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-key
string
header
required

Body

application/json

Input model for public FLUX.2 erase.

image
string
required

Base64-encoded input image.

mask
string
required

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

dilate_pixels
integer
default:10

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

Required range: 0 <= x <= 100
seed
integer | null

Optional seed for reproducibility.

Example:

42

safety_tolerance
integer
default:2

Tolerance level for input and output moderation. Between 0 and 5, 0 being most strict, 5 being least strict.

Required range: 0 <= x <= 5
Example:

2

output_format
enum<string> | null
default:png
Available options:
jpeg,
png,
webp
webhook_url
string<uri> | null

URL to receive webhook notifications

Required string length: 1 - 2083
webhook_secret
string | null

Optional secret for webhook signature verification

Response

Successful Response

id
string
required
polling_url
string
required
cost
number | null

Cost in credits for this request

input_mp
number | null

Input megapixels (2 decimal places)

output_mp
number | null

Output megapixels (2 decimal places)