ComfyUI Node

RMBG Config

The settings hub that never touches a pixel

By TeutonicMepheles·Created 2 months ago·Updated 2 days ago· 0
RMBG Config
  • background_color
  • background
  • background_color
backgroundAlpha

Background removal is one of the most commoditized jobs in ComfyUI - the KB's background-removal doc walks through rembg, BiRefNet, InSPyReNet and friends, and the honest summary is that the models are free, fast, and everywhere. What trips people up is less the model and more the settings: which background should the extractor keep (alpha? a solid color? the original?), and if it's a color, which color. If your workflow has several RMBG Mask Extractor nodes, you're about to set that dropdown and color picker in three different places. RMBG Config centralizes both settings so the extractor's background choice lives in exactly one spot.

The key thing to know before you reach for it: this node does no segmentation itself. It's a configuration source - two settings in, two settings out - that plugs into the RMBG mask-extractor node (the pack's docs target the node shown as "Mask Extractor (RMBG)", class AILab_MaskExtractor). The actual background removal, and the model download that comes with it, happens in that extractor node. This one just drives its background parameters.

How it works

Two inputs, two outputs, zero pixels touched:

  • background - Alpha, original, or Color. Alpha keeps the transparent channel (a cutout on a transparent background - ideal for compositing or a LoRA dataset, though note the KB's warning about background-removing dataset images); original leaves the background in place (removal effectively disabled); Color swaps the background for a solid color you choose with background_color. Default Alpha.
  • background_color - a color-code input, default #FFFFFF. Only meaningful when background is Color.

The one subtle piece of engineering is the output type. The background output is intentionally a wildcard (*) rather than a fixed combo, because different RMBG nodes expect the dropdown value differently - some want the two-option form, the Mask Extractor wants a three-option form. The wildcard keeps this one config compatible with both while the widget still constrains what values get emitted. If you've ever fought a config node whose socket type didn't match the consumer, that's the trap this design dodges.

How to install it

Part of the DAELab pack. ComfyUI Manager, search "ComfyUI-DAELab-Custom-Nodes-Library", or:

cd ComfyUI/custom_nodes
git clone https://github.com/TeutonicMepheles/ComfyUI-DAELab-Custom-Nodes-Library

then restart. This node itself needs nothing - no model, no key. But it's only useful with an RMBG extractor installed, and that node is where the real dependency lives: the RMBG/background-removal model (a several-hundred-MB download in most implementations) and whatever custom-node pack provides the extractor. It's a V3 node, so keep ComfyUI Core current - No module named 'comfy_api' in the log means update Core.

Common issues & troubleshooting

"I set it to Color but the output still has the original background." Double-check which background value is wired downstream. original and Color look similar in some UIs - Color is the one that actually changes the background. Also confirm the extractor node is set to consume these sockets and isn't using a built-in widget.

"The socket won't connect to my extractor." The background output is a wildcard specifically so it will connect to the common RMBG extractor forms. If it still won't, your extractor is a different node family - check its input type.

"The color doesn't take effect." Some extractors treat the color as a separate optional socket. Wire background_color into the extractor's color input if it has one, rather than assuming the config's value is read implicitly.

CategoryDAELab/RMBG

Inputs (2)

NameTypeDefaultDescription
backgroundCOMBOAlpha3 options: Alpha, original, Color
background_colorCOLORCODE#FFFFFF

Outputs (2)

NameTypeDescription
background*
background_colorCOLORCODE