BiRefNet Ultra (RBS)
Five cutout models in one dropdown
- image
- mask
- image
- mask
BiRefNet is the default answer to "cut the subject out" these days - the MIT-licensed network that finally made hair and fur edges look like someone actually cared. This node is the flagship of the RemoveBackgroundSuite pack: feed it an image, get back an RGBA cutout and a mask, with five BiRefNet-family models behind one version dropdown and a model auto-downloader that does the boring part for you.
What makes it "Ultra" is less the models and more the glue. Plenty of BiRefNet wrappers exist, and most of them quietly break the day transformers updates because BiRefNet's config class is missing the is_encoder_decoder attribute that newer transformers expects. This node patches that at load time - it imports the model's own config, slaps the attribute on, and carries on. You get the 'Config' object has no attribute 'is_encoder_decoder' crash on other packs; here it's handled before you ever see it. The author wrote a whole fix README about it, which is the rare case of a maintainer fixing the annoying bit instead of telling you to edit model files by hand.
Picking the model is the real decision
The version dropdown is where this pack earns its keep. Default is BiRefNet-General (1024px weights, the general purpose choice). Then:
BiRefNet_HR- trained at 2048px. Use it for anything above roughly 1500px; feeding a 4K image to the 1024 model internally downscales it and throws away the edges you were trying to save.BiRefNet_dynamic- trained across 256–2304px, so it stays robust on mixed or unknown input sizes. The right pick for a batch of inconsistent images.BiRefNet_HR-matting- predicts fractional alpha instead of a hard mask. That's the one for veils, glass, smoke, motion blur - anything genuinely half-transparent.RMBG-2.0- the Bria model, a different family shoehorned into the same dropdown.
The node downloads whatever you pick into ComfyUI/models/BiRefNet/<version>/ on first use via HuggingFace Hub. That first run is not a hang, it's several gigabytes of checkpoint pulling - HR especially is chunky, so budget disk space.
What you actually set
max_megapixels(default 2.0) - the important knob. Images above this get downscaled to fit (rounded to a multiple of 32), processed, then resized back to original. At the 2MP default, a 4K source gets silently shrunk; raise it to 8–16 for large inputs.device- cuda or cpu. Defaults to cuda.auto_use_original_mask(default on) with the optionalmaskinput - the genuinely useful trick. If a valid mask arrives, the node skips model inference entirely and just applies your mask as the alpha channel. Hand-fix a mask, or feed one from SAM, and you get a clean transparent cutout without re-running the model.
Outputs and wiring
Two outputs: image (RGBA, straight into a Save Image node set to PNG) and mask (the segmentation, if you want to refine it downstream - see the pack's Mask Process Details node).
Install and gotchas
git clone https://github.com/whmc76/ComfyUI-RemoveBackgroundSuite.git into custom_nodes, then pip install -r requirements.txt and restart. ComfyUI Manager also finds it by title if you search "RemoveBackgroundSuite".
The traps are mostly download-related: first run needs internet and a few GB free, and if you see the old transformers error despite the patch, update the pack (the fix landed in v1.2.3). Otherwise it's about the cheapest path to genuinely good cutouts this side of ComfyUI's native BiRefNet support.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| version | COMBO | BiRefNet-General | 5 options: BiRefNet-General, RMBG-2.0, BiRefNet_dynamic, BiRefNet_HR, BiRefNet_HR-matting |
| device | COMBO | 2 options: cuda, cpu | |
| max_megapixels | FLOAT | 2.01–999 | — |
| auto_use_original_mask | BOOLEAN | true | — |
| maskopt | MASK | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |