Nodes/comfyui_bmab/BMAB Remove Background
ComfyUI Node

BMAB Remove Background

Cutout plus mask in one node

By portu-sim·Created 2 years ago·Updated 8 months ago· 124
BMAB Remove Background
  • image
  • image
  • MASK
channel

Background removal is one of the most commoditized operations in the whole ecosystem at this point - free, fast, and every custom node pack seems to ship its own version. BMAB's is a straightforward one: feed it an image, pick your channel mode, and get back a cutout plus a mask you can reuse. The README doesn't name which model runs under the hood, so treat this as "a solid background remover with an unspecified backbone" rather than assuming it's any particular named model like BiRefNet or rembg's u2net - worth knowing since the field genuinely has meaningful quality differences between options, particularly on hard cases like flyaway hair or semi-transparent material.

Why the mask output matters as much as the cutout

A lot of background-removal use isn't actually about the final transparent PNG - it's about getting a clean mask you can hand to something else. Product photography compositing, generating a new background behind an isolated subject, or driving a selective inpaint all want the mask more than the RGBA image. This node gives you both from one call, so you're not chaining a separate mask-extraction step afterward.

The inputs and outputs that matter

  • image (required) - your source image.
  • channel (enum: RGBA / RGB, required) - RGBA gives you a proper transparent cutout with alpha baked in; RGB gives you the same subject isolation without an alpha channel, useful if a downstream node in your graph doesn't handle transparency well or you're about to composite over a solid background anyway.
  • Outputs: image (the cutout) and MASK (the extracted region as a standalone mask).

How to install it

ComfyUI Manager: search comfyui_bmab. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/portu-sim/comfyui_bmab.git
cd comfyui_bmab
pip install -r requirements.txt

Companion packs per the README: Fannovel16/comfyui_controlnet_aux and cubiq/ComfyUI_IPAdapter_plus, both already in ComfyICU's shared image if you're running there.

Common issues & troubleshooting

Hair, fur, or semi-transparent material (glass, veils, smoke) comes out with a hard, clipped edge. This is the honest limit of most segmentation-style background removers, not a BMAB-specific bug - a model that labels each pixel foreground-or-background structurally can't represent a half-transparent pixel the way a dedicated matting model can. If your subject has a lot of fine detail at the edge, be prepared to compare this node's output against a dedicated matting-capable remover before committing to it for anything that needs to look clean at full size.

The cutout looks fine small but rough at high resolution. Segmentation models generally have a native training resolution, and feeding them something much larger downsamples internally before the mask comes back up-scaled - which throws away exactly the fine edge detail you're trying to preserve. If you're working above roughly 1500px, don't assume more input resolution automatically buys you a cleaner result.

You're prepping images for LoRA training and reached for this node to "clean up" the dataset first. Don't. Stripping backgrounds from training images is one of the more repeated mistakes in the ecosystem - it teaches the trained model to default to blank backgrounds, and most trainers fill the transparent area with a flat color anyway, so you end up training on your subject against a solid field rather than the variety you actually wanted.

CategoryBMAB/imaging

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
channelCOMBO2 options: RGBA, RGB

Outputs (2)

NameTypeDescription
imageIMAGE
MASKMASK