Background Remover (Color)
Background Remover (Color)
- image
- image_rgba
- mask
What it actually is
This is a chroma keyer, not a neural net, and it's honest about it. No model downloads, no VRAM, no GPU, no API key - the README flags it [WIP], and it earns that tag. What it does well is one specific job: strip a solid-color background out of a raster image in milliseconds.
The idea is almost comically simple. The node samples the four border rows of your image, averages them to guess the background color, then removes every pixel within a distance threshold of that guess. Deterministic, CPU-only, free. If your subject sits on a flat white or black background - a product shot, a flat illustration, an icon - this is genuinely the right tool, and reaching for a multi-gigabyte segmentation model here buys you nothing. If you have hair, fur, or transparency, stop reading this node's docs and go grab BiRefNet, which ComfyUI now ships in core. The edge-quality frontier moved past chroma keying years ago; this node never claimed to live there.
How it works and what you set
The node computes the key color from the image borders, then keys on Euclidean distance in RGB space. The three inputs are all you get, and all three matter:
image- your raster, flat background or nothing.threshold(default0.1, range 0–1) - edge softness/fuzziness. Higher eats more of the image; lower leaves a colored fringe.invert_mask- flip the selection, keeping the background instead of the subject. Handy if the subject is what you want gone.
It returns two outputs, and the second is the sleeper: image_rgba is the subject on a transparent background, and mask is a clean black-and-white silhouette. That mask is what drives inpainting, ControlNet, and compositing further down your graph - in this pack, it's the raster cleanup step after the Vectorizer.ai API node has done its thing.
Installing it
Same pack as the Vectorizer.ai API node, so one install gets you all three. ComfyUI Manager: search "Vectorizer API", install, restart. Or:
cd ComfyUI/custom_nodes/
git clone https://github.com/rickrender/ComfyUI-Vectorizer-API
cd ComfyUI-Vectorizer-API
pip install -r requirements.txt
The requirements are just requests, lxml, and CairoSVG. This node specifically needs none of the heavy stuff - if you only ever key flat colors, it works even with the API parts unconfigured. The nodes land under Conversion.
Where people get burned
- Subject touching the border. The key color is an average of the borders, so if your subject bleeds to the edge, it contaminates the guess and you key out part of your subject. Pad the image first.
- Gradients and shadows. This is a hard binary decision at the threshold - no soft matte, no spill suppression. A soft shadow under your subject becomes a jagged halo. Raise
thresholdto soften it and you eat more of the image; it's a trade, not a fix. - Threshold tuning is fiddly. Start at
0.1, nudge by0.01, and inspect the mask output - the mask is the honest preview of what survives. - One color, one guess. It keys the average border color, so a gradient or vignette background won't go cleanly no matter what you set.
One last thing, and it applies to every background remover you own: don't strip the backgrounds off your entire LoRA training set. It teaches the model to output blank backgrounds, and the cut itself roughens lines. This node is for compositing and stickers, not dataset prep.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| threshold | FLOAT | 0.100–1 | — |
| invert_mask | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image_rgba | IMAGE | — |
| mask | MASK | — |