🔥BiRefNet_Lite
It's called Lite, but it'll happily load the full-size BiRefNet
- image
- image
- mask
🔥BiRefNet_Lite is the workhorse node of the rubi-du/ComfyUI-BiRefNet-Super pack, and the name is a leftover. It doesn't force the lightweight BiRefNet weights on you - it will happily load the full-size general model, the portrait model, or the high-res HR weights. It also doesn't call any API and needs no key. The "Lite" dates back to the pack's original name, ComfyUI-BiRefNet-lite, before it was renamed "Super" in December 2024. All of it runs on your machine.
You reach for it for the thing BiRefNet got adopted for: cutting out subjects with genuinely hard edges - flyaway hair, fur, fabric mesh. rembg's u2net is fast and tiny and visibly wrong on exactly those cases. BiRefNet is MIT-licensed, runs in under a second at typical resolutions, and the quality difference shows in a side-by-side rather than in a spec sheet. ComfyUI added native BiRefNet support in May 2026, so you can skip this pack entirely if you're on a recent build. What this node adds is knobs: chunked loading for small VRAM, model caching, and three cutout methods.
How it works
Under the hood it loads the model through transformers (AutoModelForImageSegmentation with trust_remote_code) from a local folder under models/birefnet - the default local_model_path is BiRefNet. The image is resized to 1024×1024 internally, the mask is computed, and then interpolated back to your original dimensions.
That last part is the gotcha that burns people: the internal resolution is hardcoded at 1024. Feed it a 4K image and it downscales before inference, so the fine edge detail you wanted is gone regardless of how good your weights are. It's the single most common self-inflicted quality loss with BiRefNet, and it lives in the code.
The inputs that matter
The full list is long, but a beginner only touches a few:
- image - the IMAGE tensor from your Load Image.
- load_local_model (default true) - loads from a folder under
models/birefnetthat you pointlocal_model_pathat. Flip it off and the node auto-downloadsZhengPeng7/BiRefNetfrom HuggingFace instead (note: the remote path skips chunked loading). - device (default
auto) - picks CUDA when it's there, CPU otherwise.mps,xpuandmetaexist too if you're on those backends. - cutout_func -
putalpha(default) applies the mask straight as the alpha channel;naivecomposites onto a transparent canvas;alpha_mattingruns pymatting trimap refinement, which is slower but the best option for hair, and uses the threealpha_matting_*thresholds below it. - mask_precision_threshold (default 0.1) - binarizes the mask: values at or below 0.1 go to 0, everything above goes to 1. Set it to 0 to keep the soft grayscale mask instead.
- cpu_size - the chunked-loading knob. On CUDA with
cpu_size > 0, the pack caps the GPU at roughly 3GB and spills the rest of the model into CPU memory. This is how people run big weights on 4–6GB cards.
Both outputs are what you'd expect: image (the RGBA cutout) and mask. Wire the image into a Save Image; wire the mask into anything that wants one - inpainting, IC-Light relighting, compositing.
Installing it
Easiest is ComfyUI Manager: search for "ComfyUI-BiRefNet-Super" and install. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/rubi-du/ComfyUI-BiRefNet-Super.git
cd ComfyUI-BiRefNet-Super
pip install -r requirements.txt
# restart ComfyUI
The pack's requirements pull in timm, pymatting, scikit-image, scipy, pooch, and both onnxruntime and onnxruntime-gpu. Torch and transformers come from ComfyUI itself. For a local model, drop a HuggingFace folder into models/birefnet/:
cd ComfyUI/models/birefnet
git clone https://huggingface.co/ZhengPeng7/BiRefNet_lite-2K BiRefNet_lite-2K
Then set local_model_path to BiRefNet_lite-2K.
One honest note: if your machine is loaded and your edges are simple, rembg is still enough and lighter. If you're here for hair and feathers, this is the node - just don't expect 4K edges out of a 1024-internal model, and run it on your three hardest images before you standardise on it.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| load_local_model | BOOLEAN | true | — |
| device | COMBO | auto | 6 options: auto, cuda, cpu, mps, xpu, meta |
| cutout_func | COMBO | putalpha | 3 options: putalpha, naive, alpha_matting |
| mask_precision_threshold | FLOAT | 0.100–1 | — |
| cached | BOOLEAN | true | — |
| cpu_size | FLOAT | 0.00 | — |
| alpha_matting_foreground_threshold | INT | 240 | — |
| alpha_matting_background_threshold | INT | 10 | — |
| alpha_matting_erode_size | INT | 10 | — |
| local_model_pathopt | STRING | BiRefNet | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |