Inspyrenet Rembg Advanced
The threshold knob the basic node doesn't give you
- image
- IMAGE
- MASK
This is the same InSPyReNet background remover as the plain Inspyrenet Rembg node, plus one extra dial: a threshold. The pack's changelog literally says this node exists to "support threshold" - it was added after the basic node shipped, specifically for people who ran into cutouts that were too aggressive or too soft and had no way to fix it. If you've never needed that control, the basic node is simpler and does the same job. If you have, this is the one you want.
Why the threshold matters
InSPyReNet doesn't output a clean yes/no per pixel internally - like any segmentation network, it produces a confidence value for "how foreground is this pixel," and something has to decide where the cutoff falls to turn that into an actual mask. The basic node makes that call for you at a fixed default. This node exposes it: raise the threshold and only the pixels the model is genuinely confident about survive, which tightens edges but risks clipping soft detail like flyaway hair. Lower it and you keep more of the uncertain, faint pixels - softer, more forgiving edges, but with more risk of background haze bleeding into what should be transparent. It's the exact same segmentation-vs-matting trade-off that runs through this whole space: a hard mask is a binary call, and the threshold is where you draw that line.
How it works
Mechanically identical to the base node - same InSPyReNet model, same image-pyramid approach that reads the picture at multiple scales to keep both the big-picture subject and the fine boundary detail. The only difference is that instead of the pack picking the cutoff for you, you set it.
The inputs and outputs that matter
image- the image (or batch) to cut out. Same batch-optimized path as the base node, so it's fine for video frames too.threshold- a float from 0 to 1, default 0.5, step 0.01. This is the one you'd actually reach for: nudge it up if your cutout is including too much background haze around the edges, nudge it down if it's eating into your subject (common with thin hair strands or fine fabric). Small moves matter here - try 0.1 increments before jumping further.torchscript_jit- same toggle as the basic node,defaultoron. Traces the model with PyTorch's JIT compiler when enabled: slower first run, faster and lighter on GPU memory after that. Worth turning on if you're running this over a batch.
Outputs are the same pair as the basic node: IMAGE, the cutout, and MASK, the alpha you'd feed into a compositing or inpainting node downstream.
How to install it
It ships in the same pack as the basic node, so one install covers both. Via ComfyUI Manager: search ComfyUI-Inspyrenet-Rembg, 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. No separate model download for this node specifically - it uses the same pretrained InSPyReNet weights the basic node pulls automatically on first use, so if you've already run the basic node once, this one has nothing left to fetch.
Common issues & troubleshooting
You changed the threshold and nothing looked different. The effect is usually subtle at the extremes of an image that's already a clean, high-contrast subject - the model was already confident, so moving the cutoff doesn't reclassify much. You'll see the threshold matter most on genuinely ambiguous edges: wispy hair, semi-transparent fabric, motion blur.
Fine hair still looks chopped no matter what you set. That's a ceiling on the model itself, not a setting you're missing - InSPyReNet, like every segmentation model, outputs a hard foreground/background call. On real semi-transparency (veils, glass, smoke) no threshold value fixes it, because the output type is wrong for the job; you'd need a dedicated matting model instead, which this node doesn't provide.
Not sure you even need this node. If you're not fighting edge quality, the plain Inspyrenet Rembg node does the identical job at a sane default and one fewer input to think about. Reach for Advanced specifically when a cutout comes back with visible haze or clipped detail and you need to correct it rather than re-run and hope.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| threshold | FLOAT | 0.500–1 | — |
| torchscript_jit | COMBO | 2 options: default, on |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |