🔧 InSPyReNet TransparentBG
Loading the background-remover BiRefNet's rival
- REMBG_SESSION
Background removal has more contenders than you'd expect for something that sounds solved, and this node loads one of the better ones: InSPyReNet, via the transparent-background package its author ships as a standalone library. It predates the currently-trendier BiRefNet, and the two have been trading wins in community tests for a couple of years now - neither has cleanly won, and the honest answer is "test both on your hardest images." This node is how you get InSPyReNet into a ComfyUI graph.
What it actually does
This node doesn't remove a background by itself - it loads the model session. TransparentBGSession sets up InSPyReNet with your chosen settings and hands back a REMBG_SESSION object, which you then feed (alongside your actual image) into a downstream "remove background" node elsewhere in your graph that consumes that session type. Think of it as the model-loader half of a two-node pair: this one loads the brain, the other one does the cutting.
InSPyReNet's own pitch is an image-pyramid architecture - it analyzes the image at multiple scales simultaneously, which is how it holds onto both global context (where's the subject) and fine boundary detail (where exactly does the hair end) at the same time. It's MIT licensed and has been around since 2022, well before BiRefNet showed up and became the more commonly recommended default. As of ComfyUI adding native BiRefNet support in mid-2026, BiRefNet has the edge in mindshare - but community head-to-heads have found InSPyReNet winning on specific images even against BiRefNet's high-res variant, so it's still worth having in your toolkit rather than treating it as obsolete.
The inputs and outputs that matter
Only two settings, both about how the underlying model runs:
mode- one of three variants:base(the standard model),fast(a lighter, quicker checkpoint that trades some quality for speed), orbase-nightly(the latest, less-tested weights).use_jit(BOOLEAN, defaulttrue) - enables TorchScript JIT compilation for faster inference. Community reports on InSPyReNet consistently mention running with this ("torchscript_jif") on for real-world speed.
Output: a single REMBG_SESSION - not an image, not a mask. Wire it into the paired background-removal node in this pack that accepts a REMBG_SESSION plus an IMAGE.
How to install it
Via ComfyUI Manager: search "ComfyUI Essentials," install, restart ComfyUI. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/cubiq/ComfyUI_essentials
The pack installs the transparent-background Python dependency for you. That library downloads its actual model weights on first use, not at install time - expect a one-time delay and some extra disk usage the first time you actually run this node, not when you clone the repo.
Common issues
First run is slow / seems to hang. That's the model weights downloading in the background on first use - check your ComfyUI console output before assuming it's frozen. Subsequent runs are fast once the weights are cached locally.
JIT compile errors. use_jit speeds things up, but TorchScript compilation can be finicky across certain GPU/PyTorch version combinations. If you hit an error tied to JIT compilation specifically, flip use_jit to false and try again before digging further.
Edges look rough on fast mode. That's the trade-off it's named for - switch to base (or base-nightly if you want the newest weights) if quality matters more than speed for a given image.
BiRefNet gives noticeably better results on your images. That's a real, documented possibility, not a sign anything's broken - the community consensus as of mid-2026 leans toward BiRefNet as the default recommendation, with InSPyReNet still winning specific cases. If you're not happy with a result here, it's worth comparing against a BiRefNet node before assuming InSPyReNet (or this node) is misconfigured.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | 3 options: base, fast, base-nightly | |
| use_jit | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| REMBG_SESSION | REMBG_SESSION | — |