Load BiRefNet model by name
Load BiRefNet model by name — the loader you'll actually reach for
- model
- train_w
- train_h
- norm_params
BiRefNet is the default answer when someone asks "how do I cut out hair without it looking like a crime scene," and this node is the cleanest way to get all of it into a ComfyUI graph. ComfyUI added BiRefNet to core in May 2026, so you can run the plain 1024 model natively now - but that gets you one checkpoint. This loader hands you sixteen, auto-downloaded on demand, from the exact ZhengPeng7 repositories the model is famous for.
It's part of Salvador E. Tropea's ComfyUI-RemoveBackground_SET pack (the set-soft author of ComfyUI-ImageMisc), announced on r/comfyui in October 2025. Every loader in the pack works the same: pick a name, it downloads the weights into ComfyUI/models/rembg, and you get a SET_REMBG model output plus the training resolution and normalization parameters.
Which of the sixteen to pick
The model_name dropdown is where BiRefNet's entire weight zoo lives, and the resolution you feed it matters more than which checkpoint you chose:
BiRefNet General(424 MiB, 1024×1024, fp16) - the default. This is what "BiRefNet" means to most people.BiRefNet General (HR=2048)- for inputs above roughly 1500px. Feeding a 4K photo to the 1024 model makes it downscale internally and throws away exactly the edges you were trying to keep. This is the one the community actually means by "BiRefNet HR."General 2K Lite(170 MiB, 2560×1440) - Swin-Tiny backbone, trained with flexible sizing. Great on modest GPUs.General dynamic res- trained across 256–2304. The pick for batches with unpredictable input sizes.Matting/Matting (HR=2048)/Matting Lite- these predict fractional alpha, not a hard foreground/background label. If your subject has a veil, glass, smoke, or real partial transparency, this is the output type you need; a segmentation model structurally can't represent half-transparent pixels.Portrait,DIS,HRSOD,COD- task-specific checkpoints. Usually you want General.BiRefNet BRIA v2.0(844 MiB) - a BiRefNet trained by BRIA on a proprietary dataset. The node will literally print a warning when you load it: not for commercial use. Fine for personal work, a legal question mark for a product.
Inputs and outputs
You set model_name, and usually leave device and dtype on AUTO (fp16 inference is validated as essentially lossless and halves VRAM). Outputs:
model(SET_REMBG) - wire this intoRemove background/Remove background (full)/Get background mask.train_w,train_h- the resolution the checkpoint was trained at; the simple remove node uses them automatically, and the advanced nodes want them wired from here.norm_params- only for manual pre-processing with Image Misc'sArbitrary Normalize.
Install and gotchas
Install via ComfyUI Manager (search "Remove Background (SET)") or:
cd ComfyUI/custom_nodes
git clone https://github.com/set-soft/ComfyUI-RemoveBackground_SET
pip install -r ComfyUI-RemoveBackground_SET/requirements.txt
You need ComfyUI 0.3.48+. The pack's only extra dependency is seconohe (>=1.0.6); if the loader throws on first run, pip install git+https://github.com/set-soft/seconohe.git for a fresh copy. First use of each checkpoint downloads it into ComfyUI/models/rembg - the dropdown includes the size in each name so you know what you're pulling.
Bottom line: this is the pack's crown jewel loader. Run General (HR=2048) in fp16 on your hardest hair shot, then A/B it against InSPyReNet from the sibling loader - the argument isn't settled, but this is the default side to start from.
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. |