FLUX Erase
Remove anything, and let the background heal
- image
- mask
- advancedFeatures.watermark.image
- image
FLUX Erase is the "get this thing out of my photo" model. It's a focused, API-only BFL model that takes an image plus a mask and regenerates the masked region as if the object was never there - no smudge, no clone-stamp tell, just a plausible background that was definitely always behind it. Where classic inpainting models often leave artifacts on object-shaped holes, Erase is specifically tuned to make removals invisible.
You'll want to pair it with a segmentation step upstream: get a mask (SAM-style node, BiRefNet, whatever your workflow already has), feed image + mask into this node, and the output is the cleaned scene.
How it works
A taskType: imageInference REST call (model bfl:flux@erase). Both the image and the mask go up as data URIs; the model in-fills the masked region with plausible continuation. The one tuning knob you actually set is how much the mask boundary gets expanded before erasing.
Inputs that matter
- image - the photo. Required.
- mask - the region to erase. Required, and note the type: it's an
IMAGEsocket here, notMASK. You'll feed a black-and-white mask image (white = erase) from whatever generated it. - settings.dilatePixels - 0–25, default 10. This expands the mask before erasing so the model fully covers object edges and catches thin outlines, soft edges, and partial shadows the segmentation missed. The tooltip's guidance is actually good: masks from SAM-style tools → start at 10; soft-edged subjects like hair, fur, or smoke → 15–20.
- numberResults - variants; erasure can be non-deterministic, so generating a few and picking is a legit strategy.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Runware/ComfyUI-Runware
pip install -r ComfyUI-Runware/requirements.txt
Or ComfyUI Manager → search Runware → Install → restart. API key in ComfyUI Settings → Runware API key or RUNWARE_API_KEY. Prepaid top-up; per-run cost on the title bar.
Gotchas
- A bad mask gives a bad erase. The model can't fix what your segmentation missed - that's literally what
dilatePixelsexists for, so actually use it. - Output is a fresh JPG by default. If you're reusing the result downstream (like layering back into the original at full quality), set PNG.
- It's a BFL API model, so there's BFL moderation under the hood via the
safety/safety.checkContenttoggles. Erasing a person from a photo is fine; don't get creative with the moderation settings.
The one-liner: segmentation upstream, erase in the middle, clean scene out. FLUX Erase is the most single-purpose node in the pack, and for object removal specifically, it's the one you want.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | IMAGE | — | |
| advancedFeatures.watermark.imageopt | IMAGE | — | |
| numberResultsopt | INT | 11–20 | Number of results to generate. Each result uses a different seed, producing variations of the same parameters. |
| advancedFeaturesopt | BOOLEAN | false | Enable to set advancedFeatures. Off uses the model's default. |
| advancedFeatures.watermark.bgColoropt | STRING | Background color in hex format. | |
| advancedFeatures.watermark.displayPositionopt | COMBO | (default) | Watermark position. |
| advancedFeatures.watermark.fontColoropt | STRING | Text color in hex format. | |
| advancedFeatures.watermark.opacityopt | BOOLEAN | false | Enable to set advancedFeatures.watermark.opacity. Off uses the model's default. |
| advancedFeatures.watermark.opacity_valueopt | FLOAT | 0.100.1–1 | Watermark opacity. |
| advancedFeatures.watermark.textopt | STRING | Watermark text. | |
| settings.dilatePixelsopt | INT | 100–25 | Expands the mask boundary by this many pixels before erasing. Helps the model fully cover object edges and catch details the mask may have missed, such as thin outlines, soft edges, or partial shadows. For masks generated by SAM or similar segmentation tools, start with 10. For soft-edged subjects like hair, fur, or smoke, use 15-20. |
| safetyopt | BOOLEAN | false | Enable to set safety. Off uses the model's default. |
| safety.checkContentopt | BOOLEAN | false | Enable or disable content safety checking. |
| ttlopt | BOOLEAN | false | Enable to set ttl. Off uses the model's default. |
| ttl_valueopt | INT | 60 | Time-to-live (TTL) in seconds for generated content. Only applies when `outputType` is `URL`. |
| outputFormatopt | COMBO | JPG | File format for the generated image. |
| outputQualityopt | INT | 9520–99 | Compression quality of the output. Higher values preserve quality but increase file size. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |