Nodes/Rembg Background Removal Node for ComfyUI/Image Remove Background (rembg)
ComfyUI Node

Image Remove Background (rembg)

The ComfyUI node that just cuts out the subject

By Jcd1230·Created 3 years ago·Updated 2 years ago· 185
Image Remove Background (rembg)
  • image
  • IMAGE

If you just want an image with the background gone and don't want to think about it, this is the node. Image Remove Background (rembg) takes one IMAGE in and hands you one IMAGE back with the background stripped out - no model dropdown, no device picker, no threshold sliders. You plug it in, it runs, you get a cutout. That's the entire feature set, and depending on your patience for fiddly nodes, that's either exactly what you wanted or a little too bare-bones.

What it actually does

Under the hood it's a thin ComfyUI wrapper around rembg, the Python library that's been the go-to for one-line background removal since 2020. rembg wraps a handful of segmentation networks behind a simple API - historically u2net, a salient-object-detection model that's fast, tiny, and runs fine on CPU. This node doesn't expose which model rembg uses, so you're getting whatever the library defaults to out of the box. That's fine for the case it's actually good at: a clear subject on a background that contrasts with it - a product shot, a portrait against a plain wall, a character on a flat color. It'll happily run in any workflow where you just need "subject, no background" without spending a node's worth of VRAM on something heavier.

Where it falls over is the same place every u2net-based tool falls over: hair, fur, semi-transparent stuff like glass or veils, anything with a genuinely fuzzy edge. The mask it produces is a hard yes/no per pixel, not a soft alpha - so flyaway strands get either kept whole or chopped off, never gracefully faded. That's not a bug in this specific node, it's just what the underlying model was ever built to do. If you're doing product photography or clean graphic cutouts, you probably won't notice. If you're cutting out a person with wispy hair against a busy background, you will.

Inputs and outputs

There's exactly one input and one output, and that's the whole interface:

  • image (required) - the image you want cut out. Whatever comes out of your load/generate chain.
  • Output: IMAGE - the same image with the background removed, ready to feed into a compositing node, a save node, or straight into another generation as a masked layer.

No mask output, no model selector, no alpha-matting toggle. If you need any of those, this isn't the node - more on that below.

Installing it

Same as any custom node pack: through ComfyUI Manager (search "Rembg Background Removal Node" or the repo name), or manually -

cd ComfyUI/custom_nodes
git clone https://github.com/Jcd1230/rembg-comfyui-node.git

Then, into whatever Python environment ComfyUI is running in, install the actual rembg library:

pip install rembg[gpu]   # or plain "rembg" if you don't have a CUDA setup

The README is explicit that rembg[gpu] is the recommended install if you have GPU support available - it pulls in onnxruntime-gpu instead of the CPU-only onnxruntime. Restart ComfyUI afterward and look for Image Remove Background (rembg) in the node search. There's no separate model file to download by hand - rembg fetches its model weights itself, the first time you actually run the node, into a local cache. That first run will be slower than every one after it; it's downloading, not hanging.

Where people get stuck

The recurring headache is onnxruntime vs onnxruntime-gpu living in the same environment. If something else in your ComfyUI install already pulled in plain onnxruntime, installing rembg[gpu] on top can leave you with a version conflict, or with rembg silently falling back to CPU inference. If background removal seems to be taking way longer than it should, that's the first thing to check - pip show onnxruntime onnxruntime-gpu and make sure you're not carrying both.

The other one is ComfyUI Manager occasionally failing to fully resolve dependencies on the Git-install path - heavier packages like the onnx runtimes don't always install cleanly through Manager's automated flow the way they do with a manual pip install. If the node shows up red or errors on first use, try the manual custom_nodes clone + pip install route instead.

Worth knowing before you reach for this node at all: it's one of the oldest, simplest rembg wrappers around, and the field has moved on. Newer packs (and, as of mid-2026, ComfyUI's own native background-removal support) expose model choice, device selection, and BiRefNet - which produces noticeably cleaner edges on hair and fine detail than the older u2net path this node is stuck with. Clean, high-contrast subject? This node is genuinely fine - small, fast, zero configuration. Rough hair edges you can't fix? That's not a setting you're missing; it's the underlying model, and it's worth trying a BiRefNet-based node instead.

Categoryimage

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE