About FLUX Erase
FLUX Erase removes whatever a mask covers and rebuilds the scene behind it, matching the surrounding lighting, texture and background so nothing looks patched. Objects, people, text, watermarks and whole compositions can be taken out. There is no prompt: the mask alone says what goes.
The mask is a black-and-white image at the same resolution as the input, white where pixels are to be removed and black where they are kept. A dilation setting expands the mask edge by up to 25 pixels before removal, which helps with soft-edged subjects and shadows. The output keeps the input's size.
The model was trained at about 1 megapixel across aspect ratios from 1:2 to 2:1, and inputs near that range give the best results.
Ready to build with FLUX Erase?
Try FLUX Erase in the Workbench to prompt it, compare outputs, and iterate on prompts without writing any code. When you're ready to ship, call the same model from our API and build your own apps on top of it.
curl -sSf -X POST https://hub.oxen.ai/api/ai/images/edit \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OXEN_API_KEY" \
-d '{
"model": "flux-erase",
"input_image": "https://hub.oxen.ai/api/repos/ox/Oxen-AI-Assets/file/main/images/ox_zoom_out_1926_1076.png",
"mask_url": "https://hub.oxen.ai/api/repos/ox/Oxen-AI-Assets/file/main/images/ox_zoom_out_1926_1076.png",
"dilate_pixels": 10,
"safety_tolerance": 2
}'Request parameters
Every field FLUX Erase accepts in the request body. See the API reference for response formats.
https://hub.oxen.ai/api/ai/images/edit| Field | Type | Required | Default | Description |
|---|---|---|---|---|
input_image | stringuri | Yes | — | Image to clean up. The output keeps its size. |
mask_url | stringuri | Yes | — | Black-and-white mask image at the same resolution as the input. White pixels are removed, black pixels are kept. |
dilate_pixels | integer | No | 10 | Pixels to expand the mask edge by before removal. Helps cover soft edges and shadows. Range: 0 – 25 |
seed | integernullable | No | — | |
safety_tolerance | integer | No | 2 | Safety filter strictness, 0 is strictest.012345 |