Nodes/ComfyUI-BiRefNet-lite/🔥BiRefNet_Super
ComfyUI Node

🔥BiRefNet_Super

Chunked loading for small VRAM

By rubi-du·Created 2 years ago·Updated about a year ago· 14
🔥BiRefNet_Super
  • image
  • image
  • mask
â—„load_local_modeltrueâ–º
â—„deviceautoâ–º
â—„cutout_funcputalphaâ–º
â—„mask_precision_threshold0.10â–º
â—„cachedtrueâ–º
â—„cpu_size0.00â–º
â—„alpha_matting_foreground_threshold240â–º
â—„alpha_matting_background_threshold10â–º
â—„alpha_matting_erode_size10â–º
â—„local_model_pathBiRefNetâ–º

Let's get the awkward part out of the way first: 🔥BiRefNet_Super and 🔥BiRefNet_Lite are the same node. Check the pack's source and NODE_CLASS_MAPPINGS maps both names to the one BiRefNet_Lite class - same inputs, same outputs, same code, just registered under two display names. So don't agonize over which one to drag onto your canvas. What "Super" refers to is the feature set the README brags about: chunked CPU+GPU loading, model caching, and multiple cropping methods. Those are real, and they're the reason to install this pack at all now that ComfyUI ships BiRefNet natively.

What Super gives you

The flagship feature is chunked loading, and it's the answer to the most common BiRefNet pain: "it OOM'd on my 6GB card." Set device to cuda and cpu_size to something like 8, and the node loads the model with device_map=auto, capping the GPU at about 3GB and spilling the rest into CPU memory. The model runs split across both - slower than pure-GPU, but it runs. Set cpu_size to 0 and it loads straight onto the device like a normal node.

Second is caching. With cached left on (default true), the model stays in memory between runs, so the second and third cutouts in a session are near-instant. If you're swapping models a lot, that cache is keyed on the local model path, so switching paths reloads.

Third are the cutout methods: putalpha (default - mask straight into the alpha channel), naive (composite onto transparent), and alpha_matting (pymatting trimap refinement - the slowest but the one to pick for hair, governed by the three alpha_matting_* thresholds).

Inputs and outputs

  • image - the IMAGE tensor.
  • load_local_model (default true) - reads from a folder under models/birefnet named by local_model_path (default BiRefNet). Flip it off and it auto-downloads ZhengPeng7/BiRefNet from HuggingFace - though that remote path disables chunked loading, so on a small card you'll want a local model.
  • device - auto (CUDA when present, CPU otherwise), or force cuda/cpu/mps/xpu/meta.
  • cpu_size - the chunked-loading knob above.
  • cached - keep the model in memory.
  • mask_precision_threshold (default 0.1) - binarizes the mask output (≤0.1 → black, above → white). Set to 0 to keep the soft mask.

Outputs: image (the RGBA cutout) and mask. Same pair as every node in this pack - wire image to Save Image, mask into inpainting or compositing.

Installing it and the honest limits

ComfyUI Manager, search "ComfyUI-BiRefNet-Super", or:

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

Then put a model folder in models/birefnet/ - for example git clone https://huggingface.co/ZhengPeng7/BiRefNet BiRefNet - and point local_model_path at it.

Two limits worth knowing. First, the torch path hardcodes 1024×1024 as the internal inference resolution, so even the 2048-native HR weights get fed a 1024 image through this node; you still benefit from running them, but you don't get the full high-res advantage here. Second, this pack is a quiet, small one - it has essentially no standalone Reddit presence, and most people in the ecosystem reach for ComfyUI-RMBG or ComfyUI's native support. Super's job is narrower: you want BiRefNet cutouts and your VRAM is tight. For that, the chunked loading genuinely is the thing.

Category🔥BiRefNet

Inputs (11)

NameTypeDefaultDescription
imageIMAGE—
load_local_modelBOOLEANtrue—
deviceCOMBOauto6 options: auto, cuda, cpu, mps, xpu, meta
cutout_funcCOMBOputalpha3 options: putalpha, naive, alpha_matting
mask_precision_thresholdFLOAT0.100–1—
cachedBOOLEANtrue—
cpu_sizeFLOAT0.00—
alpha_matting_foreground_thresholdINT240—
alpha_matting_background_thresholdINT10—
alpha_matting_erode_sizeINT10—
local_model_pathoptSTRINGBiRefNet—

Outputs (2)

NameTypeDescription
imageIMAGE—
maskMASK—