Load InSPyReNet model by name
Load InSPyReNet model by name — the underdog that keeps winning
- model
- train_w
- train_h
- norm_params
There is no settled winner in the BiRefNet vs InSPyReNet argument, and if you hang around background-removal threads long enough you'll see InSPyReNet recommended in the very comments where someone called BiRefNet SOTA. This loader is the pack's way of letting you test that on your own images instead of trusting a leaderboard that doesn't exist. InSPyReNet (MIT, ACCV 2022) is the image-pyramid approach: it analyses the image at multiple scales at once, which keeps global context and boundary precision in the same pass. Some material, it just beats BiRefNet.
The dropdown is the widest in the pack because this loader merges two sources. First, the built-in list of InSPyReNet checkpoints - Base 1.2.12 (351 MiB, 1024×1024, the standard one everyone means), Fast, Nightly, and a family of SwinB variants trained on specific datasets (DH, HU, DHU, DIS5K-TR, each in fast/LR and base flavors). Second, if you have the Python transparent-background tool's models in ~/.transparent-background/, this node picks those up too and lists them as "(from TB config)". That's a genuinely nice touch if you're migrating from the rembg-ecosystem tooling.
What to actually set
model_name- the checkpoint. Start withInSPyReNet Base 1.2.12. If you're on a weak GPU, the 384pxFastor LR variants run a lot cheaper, and at those sizes the pack's 3060 numbers show InSPyReNet around 661ms / 2.9GB at 1024 - heavier than BiRefNet, but far from DiffDIS territory.device- leave AUTO (your GPU).dtype- AUTO matches the weights on disk (these are fp32); forcingfloat16saves VRAM with minimal quality loss, same as everywhere in this pack.
Note the InSPyReNet Res2Net50 LR entry is flagged non-commercial in the model table - the loader warns you in the console if you pick it, same as it does for the BRIA checkpoints. The rest of the family is MIT.
Outputs
model(SET_REMBG) → straight intoRemove background,Remove background (full), orGet background mask.train_w,train_h- varies by variant (1024×1024 for base, 384×384 for the fast ones). Wire them into the advanced nodes for correct sizing.norm_params- for the manual pre-processing path.
Install
Standard for this pack: ComfyUI Manager search "Remove Background (SET)", or clone + pip install:
cd ComfyUI/custom_nodes
git clone https://github.com/set-soft/ComfyUI-RemoveBackground_SET
pip install -r ComfyUI-RemoveBackground_SET/requirements.txt
ComfyUI 0.3.48+, seconohe >=1.0.6 (fresh copy via pip install git+https://github.com/set-soft/seconohe.git if it errors). First use downloads into ComfyUI/models/rembg.
The honest advice: don't pick a side on reputation. Run Base 1.2.12 and BiRefNet General (HR=2048) on your three hardest images - the one with flyaway hair, the one with fur, the one with a glass. One of them will win on each. This node exists precisely so that comparison costs you five minutes.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | The name of the model, from the list of known models of this type | |
| device | COMBO | Device where the model will be run | |
| dtypeopt | COMBO | AUTO | Data type used for inference. `AUTO` means the same as the model on disk.Using a smaller size will save resources, but might degradate the results. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| model | SET_REMBG | The remove background model ready to be used in a processing node |
| train_w | INT | Width of the images used to train this model |
| train_h | INT | Height of the images used to train this model |
| norm_params | NORM_PARAMS | Normalization parameters for the input images. This is needed only for advanced use when you want to manually pre-process the images. The `Arbitrary Normalize` node from `Image Misc` can use these parameters to apply the correct normalization. |