Nodes/was-node-suite-comfyui/Image Remove Background (Threshold)
ComfyUI Node Runs on cloud

Image Remove Background (Threshold)

The threshold cutter, not an AI matte

By WASasquatch·Created 3 years ago·Updated about 23 hours ago· 1,840
Image Remove Background (Threshold)
  • images
  • images
mode
threshold127
threshold_tolerance2

First thing to get straight, because the name sets you up to expect the wrong thing: this node does not run BiRefNet, rembg, or any segmentation model. It has no weights to download and no GPU cost. It's a threshold cut - the README's own words are "remove the background from an image by threshold and tolerance." It looks at pixel color, decides which pixels are "background," and punches them out to transparency. That's the whole trick.

Which means it's brilliant at exactly one job and useless at everything else.

What it's actually good for

If your background is already a flat, solid, contrasting color - a blank canvas from a generation, a green screen, a white product-shot backdrop, the output of an "Image Blank" node - this is the fastest, lightest way to get an alpha channel. No model load, no VRAM, instant. You feed it an image, it hands you back one with the matching region knocked out.

Where people get burned is expecting it to handle a photo. Hair, fur, motion blur, a busy street behind the subject - it has no concept of "subject." It only knows color similarity. Point it at anything with a textured or gradient background and you'll get holes in the subject and ragged edges around it. Our background-removal notes are blunt about this: threshold-based cutouts were superseded years ago for anything hard, and the quality frontier now lives with matting models like BiRefNet-matting for semi-transparent stuff. If you're cutting out a person on a real photo, reach for a BiRefNet or InSPyReNet node instead and come back here for the easy cases.

The two knobs

Per the README, the settings that matter are threshold and tolerance. Threshold sets the color value that counts as background; tolerance widens the band around it so near-matches also get removed. Push tolerance too high and it starts eating into your subject; too low and you leave a halo of leftover background pixels. It's a two-slider balancing act, and on a genuinely flat background you'll nail it in a couple of tries. The output is an image with an alpha channel, ready to composite over something else or feed into a paste/blend node.

Installing it

It ships inside WAS Node Suite, so you install the whole pack, not this node alone. Easiest path is ComfyUI Manager - open it, search was-node-suite-comfyui, install, restart. Manual works too:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui

then install its requirements.txt into ComfyUI's Python and restart. This particular node has no extra model downloads - one of the few WAS nodes that's truly weightless.

When it won't load

Heads up on the pack as a whole: WAS Node Suite has been in maintenance-only limbo since December 2023 - the author stepped back and said as much. It still works, but on a freshly updated ComfyUI the classic failure is the whole suite showing "Import Failed." That's almost always a dependency clash: WAS pins some older packages (opencv is the usual culprit) that a ComfyUI update bumped out from under it. The fix that works for most people is reinstalling requirements.txt into the correct venv (activate it first, or run the bundled install.bat), and if it's specifically opencv, pinning it back down. Frustrating, but it's a one-time reconcile, not a broken node.

CategoryWAS Suite/Image/Process

Inputs (4)

NameTypeDefaultDescription
imagesIMAGEThe images to cut out. Each is handled on its own.
modeCOMBOWhich part of the image to clear, decided on brightness alone. `background` clears every pixel at or below the threshold, so a dark backdrop goes and the light part is kept. `foreground` clears every pixel at or above it, so a white studio sweep goes instead.
thresholdINT1270–255Brightness the cut is made at, 0 for black and 255 for white; 127 cuts at mid grey. In `background` mode everything this dark or darker is cleared, so raising it clears more of the image; in `foreground` mode everything this bright or brighter is cleared, so raising it clears less.
threshold_toleranceINT21–24How much the brightness is blurred before the cut, in pixels. Small values follow the edge closely but keep speckles; larger values give a smoother outline that creeps in over fine detail such as hair.

Outputs (1)

NameTypeDescription
imagesIMAGEThe images with an alpha channel, transparent wherever the threshold cut them away.