RembgByBenAdvanced
The same BEN cutout, every knob exposed
- model
- images
- image
- mask
RembgByBenAdvanced is RembgByBen with the training wheels off. Same two-step pipeline - BEN mask, then blur-fusion foreground color estimation - but nothing is hidden behind defaults, which means you can fix the cases where the one-click version isn't good enough.
Under the hood, and it's worth knowing because it explains the interface: this class literally inherits from GetMaskByBen and BlurFusionForegroundEstimation, and its single function calls both in order. Every input you see belongs to one of those two steps.
- Segmentation side:
width/height(1024) - the preprocess resolution the model sees; does not affect the final output size.upscale_method(bilinear) - interpolation used for the preprocessed image and the mask resize.mask_threshold(0) - set above 0 to zero out low-confidence pixels and scrub floating noise off the mask. - Foreground side:
blur_size(91) andblur_size_two(7) - the coarse and fine blur radii for the Photoroom fast-foreground-estimation defringing.fill_color(false) andcolor(0–16777215, i.e. 0xFFFFFF) - flipfill_coloron to replace transparency with a solid RGB background instead.
Outputs: image (the RGBA cutout, or solid-background if you filled) and mask.
When do you actually need the knobs? A few honest cases:
- Small or low-res subject: drop
width/heightto 512. The 1024 default is overkill and just slows you down. - Hair with a grey fringe that won't die: lower
blur_sizefrom 91 toward ~31 so the halo removal doesn't smear the fine strands. - A mask full of specks: nudge
mask_thresholdup to ~0.02–0.05 and watch the preview. Too high and you'll eat the soft edges. - Product mockup on a coloured backdrop:
fill_coloron,colorset to your brand hex.
Install and model situation are shared with the whole pack: clone, pip install -r requirements.txt, restart ComfyUI, and put BEN_Base.pth or BEN2_Base.pth in ComfyUI/models/rembg/ben/ - nothing auto-downloads, and the filename decides BEN vs BEN2 (see LoadRembgByBenModel).
My take: run RembgByBen first. If the output is clean, you never needed this node. The moment you hit a fringe you can't explain, switch to this and start turning dials. The defaults are sane, but they're not magic - this is where a background-removal workflow actually gets tuned.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| model | BEN | — | |
| images | IMAGE | — | |
| width | INT | 10240–16384 | The width of the pre-processing image, does not affect the final output image size |
| height | INT | 10240–16384 | The height of the pre-processing image, does not affect the final output image size |
| upscale_method | COMBO | bilinear | Interpolation method for pre-processing image and post-processing mask |
| blur_size | INT | 911–255 | — |
| blur_size_two | INT | 71–255 | — |
| fill_color | BOOLEAN | false | — |
| color | INT | 00–16777215 | — |
| mask_threshold | FLOAT | 0.0000–1 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |