ComfyUI Node

FLUX Erase

Remove anything, and let the background heal

By Runware·Created 2 years ago·Updated about a month ago· 140
FLUX Erase
  • image
  • mask
  • advancedFeatures.watermark.image
  • image
numberResults1
advancedFeaturesfalse
advancedFeatures.watermark.bgColor
advancedFeatures.watermark.displayPosition(default)
advancedFeatures.watermark.fontColor
advancedFeatures.watermark.opacityfalse
advancedFeatures.watermark.opacity_value0.10
advancedFeatures.watermark.text
settings.dilatePixels10
safetyfalse
safety.checkContentfalse
ttlfalse
ttl_value60
outputFormatJPG
outputQuality95

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 IMAGE socket here, not MASK. 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 dilatePixels exists 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.checkContent toggles. 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.

CategoryRunware/Image/bfl

Inputs (18)

NameTypeDefaultDescription
imageIMAGE
maskIMAGE
advancedFeatures.watermark.imageoptIMAGE
numberResultsoptINT11–20Number of results to generate. Each result uses a different seed, producing variations of the same parameters.
advancedFeaturesoptBOOLEANfalseEnable to set advancedFeatures. Off uses the model's default.
advancedFeatures.watermark.bgColoroptSTRINGBackground color in hex format.
advancedFeatures.watermark.displayPositionoptCOMBO(default)Watermark position.
advancedFeatures.watermark.fontColoroptSTRINGText color in hex format.
advancedFeatures.watermark.opacityoptBOOLEANfalseEnable to set advancedFeatures.watermark.opacity. Off uses the model's default.
advancedFeatures.watermark.opacity_valueoptFLOAT0.100.1–1Watermark opacity.
advancedFeatures.watermark.textoptSTRINGWatermark text.
settings.dilatePixelsoptINT100–25Expands 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.
safetyoptBOOLEANfalseEnable to set safety. Off uses the model's default.
safety.checkContentoptBOOLEANfalseEnable or disable content safety checking.
ttloptBOOLEANfalseEnable to set ttl. Off uses the model's default.
ttl_valueoptINT60Time-to-live (TTL) in seconds for generated content. Only applies when `outputType` is `URL`.
outputFormatoptCOMBOJPGFile format for the generated image.
outputQualityoptINT9520–99Compression quality of the output. Higher values preserve quality but increase file size.

Outputs (1)

NameTypeDescription
imageIMAGE