ComfyUI Node

Inspyrenet Rembg

The one-node background remover that still beats BiRefNet on hair

By john-mnz·Created 2 years ago·Updated 2 years ago· 746
Inspyrenet Rembg
  • image
  • IMAGE
  • MASK
torchscript_jit

Background removal is a solved problem right up until you hit hair, fur, or a veil, and then suddenly it isn't. Inspyrenet Rembg wraps InSPyReNet, a segmentation model built specifically for that edge case, into a single ComfyUI node with no extra dependencies to fight. The pack author's own pitch is blunt: after testing BRIA, U2Net, IsNet, SAM and RMBG, InSPyReNet was "on a whole different level." That's a strong claim from someone selling their own node, but it holds up - this is still one of the two models people actually reach for (the other being BiRefNet, which ComfyUI now ships natively), and a good chunk of the community still argues InSPyReNet wins on the hardest cases, hair especially. Even BiRefNet's own author has shown up in a thread titled "BEST Rembg method! InSPyReNet as a ComfyUI node" and didn't push back - he just listed what he'd shipped lately. That's not nothing.

How it works

Where the older standby, u2net (what most "rembg" installs default to), just labels each pixel foreground or background, InSPyReNet analyzes the image as an image pyramid - multiple scales at once - so it keeps global context (where's the subject?) and boundary precision (where exactly does a strand of hair end?) in the same pass. That's the mechanism behind the "on a whole different level" claim: it's not a bigger u2net, it's built differently to survive exactly the edges that broke everything before it.

It's also MIT-licensed, same as the underlying model, which matters if you're building something commercial - BRIA, one of the models the author benchmarked against, doesn't allow that.

The inputs and outputs that matter

Just two required fields, which is the whole appeal of this node over the fatter multi-model packs:

  • image - the picture you want cut out. Takes a batch, too, and the pack is specifically optimized for batch throughput, which makes it a solid pick for video frames rather than one-off stills.
  • torchscript_jit - an on/off toggle (default or on). Turning it on traces the model with PyTorch's JIT compiler at startup. That costs you a slower first load, but after that it runs faster and uses less GPU memory. Leave it at default for a quick one-off image; flip it on if you're processing a batch or a video where the steady-state speed pays back the warm-up cost.

Two outputs: IMAGE, the cutout, and MASK, the corresponding alpha. Wire the mask into a compositing node, an inpaint mask input, or anywhere downstream that needs to know exactly where your subject's edges are - that's the whole reason this node gives you both instead of just the flattened result.

How to install it

Easiest path is ComfyUI Manager: search ComfyUI-Inspyrenet-Rembg, hit install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/john-mnz/ComfyUI-Inspyrenet-Rembg.git
cd ComfyUI-Inspyrenet-Rembg
pip install -r requirements.txt

Restart ComfyUI and you're done - there's no model file to hunt down yourself. The pretrained InSPyReNet weights download automatically the first time you actually run the node, so expect a one-time pause on your first generation while that happens.

Common issues & troubleshooting

First run is slow, and that's normal. Between the automatic model download and, if you've flipped torchscript_jit to on, the JIT tracing step, your very first run through this node will take noticeably longer than every run after it. Don't kill the job - check the terminal, the node prints its progress there.

Wondering if you should've used BiRefNet instead? There's no settled answer, and there probably won't be - the closest thing to a rigorous test in the community found BiRefNet HR ahead on 26 of 30 portraits, and still called the results short of production-ready without manual cleanup. Meanwhile a January 2026 thread crowned InSPyReNet the cleanest option specifically on hair. If edge quality really matters for your image, run both on your three hardest examples before you standardize on either - they're a node apart, so the test costs you nothing.

Need a threshold knob? This node doesn't expose one - it's deliberately minimal. If you're getting cutoffs you want to tune (semi-transparent edges bleeding in or out), reach for the sibling Inspyrenet Rembg Advanced node instead, which adds exactly that control.

Categoryimage

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
torchscript_jitCOMBO2 options: default, on

Outputs (2)

NameTypeDescription
IMAGEIMAGE
MASKMASK