RMBG-3.0 (RMBG)
RMBG-3.0 doesn't segment your image — it diffuses a matte out of it
- model
- clip
- vae
- image
- background_color
- IMAGE
- MASK
- MASK_IMAGE
Every other background remover in this pack is a segmentation or matting network: image in, mask out, one forward pass. RMBG-3.0 (RMBG) is not that. It's BRIA's third-generation model, and it works by generating the alpha matte with a distilled diffusion model conditioned on your image. Once you know that, the node's four required inputs stop looking weird and its failure modes stop looking random.
Why you'd run a diffusion model for a cutout
The quality ceiling for cutouts stopped moving around BiRefNet HR in early 2025 - the failure cases that remain are hair, fur, sheer fabric, glass, and subjects that share a colour family with the background. A segmentation network has to commit pixels to foreground or background and eat the damage at the edge. A generative model can paint a smooth grayscale gradient where the truth is a gradient, and it can lean on a vision-language encoder's reading of "person standing in front of a fence" rather than local pixel statistics.
That's the pitch, and it's real: RMBG-3.0 handles wispy edges and cluttered backgrounds better than the RMBG-2.0 path in the same pack. The cost is that you're loading a proper diffusion stack to remove a background.
The mechanism, concretely
The node builds a fixed instruction string - "Generate a detailed grayscale alpha matte. Map the opaque foreground to white and the background to black…" - wraps it in JSON, and tokenizes it together with your image, because the text encoder here is qwen3vl_4b: a vision-language model that sees the picture while reading the instruction. Then:
- The image is resized to roughly one megapixel, aspect-matched and snapped to multiples of 16.
- The VAE encodes it and the latent gets attached to the conditioning as a
reference_latentsentry, so sampling is image-conditioned rather than image-free. - A zeroed 128-channel latent is sampled with euler / simple / CFG 1.0, denoise 1.0, for
stepssteps. - The decoded result is averaged across channels into a single grayscale plane - that's your matte - then resized back to your original resolution with Lanczos and handed to the same mask-blur/offset/invert pipeline the rest of the pack uses.
Two hard checks in the code will stop you cold if your loaders are wrong: the encoded prompt must be 46080 dims wide (that means Load CLIP with type fibo2, i.e. qwen3vl_4b), and the VAE output must be 128 channels (that means flux2-vae.safetensors, a FLUX.2 VAE - not SDXL's, not Flux.1's).
Inputs and outputs
Four required, no defaults, no auto-download: model from Load Diffusion Model, clip from Load CLIP (type fibo2), vae from Load VAE, and image. There's no prompt field - the instruction is hardcoded. Of the optional ones, three earn their place:
sensitivity(default 1.0) - the tooltip says lower values boost semi-transparent foreground, and mechanically that's a plain multiply: the matte gets scaled by1 + (1 - sensitivity), clamped. So 0.5 doubles every alpha value. It brightens faint hair and faint background haze equally; it cannot invent strands the model never saw. Use it as a gentle nudge (0.85–0.95), not a rescue.steps(default 4) - the model is distilled for four. Going to 8 buys you very little and costs you double.refine_foreground(default off here, unlike MultiMatte) - foreground colour estimation to kill dark or tinted fringes on hair edges. On if you see fringing; off otherwise, since it softens genuinely hard edges too.
Plus seed (the matte is a sample, so tone changes slightly), mask_blur, mask_offset, invert_output, unload_model - which unloads only the diffusion model and keeps CLIP and VAE cached - and background / background_color for Alpha versus a flat composite.
Outputs are the pack's standard trio: IMAGE (RGBA if you picked Alpha), MASK, and MASK_IMAGE (mask as a 3-channel image, for previews or image-expecting inputs).
Install
Manager → search Comfyui-RMBG, or:
cd ComfyUI/custom_nodes
git clone https://github.com/1038lab/ComfyUI-RMBG
cd ComfyUI-RMBG && ../../python_embeded/python -m pip install -r requirements.txt
This node is the exception to the pack's auto-download habit. You fetch three files yourself:
ComfyUI/models/diffusion_models/ RMBG-3.0-fp8.safetensors (7.57 GB, recommended)
RMBG-3.0-nvfp4.safetensors (5.43 GB, RTX 50 series)
RMBG-3.0-bf16.safetensors (15.14 GB)
ComfyUI/models/text_encoders/ qwen3vl_4b_bf16.safetensors (or qwen3vl_4b_fp8_scaled)
ComfyUI/models/vae/ flux2-vae.safetensors
Set type = fibo2 in Load CLIP and wire MODEL, CLIP and VAE straight into the node - no separate sampler.
Troubleshooting
"RMBG-3.0 requires Load CLIP with type='fibo2'" - you pointed Load CLIP at a CLIP-L or T5 or left the type on stable_diffusion. The image-aware instruction only works through the Qwen3-VL encoder.
"RMBG-3.0 requires FLUX.2 VAE … got N channels" - you fed it the Flux.1 or SDXL VAE. Grab flux2-vae.safetensors.
VRAM. This is ~7.5GB of diffusion model plus a 4B text encoder plus a VAE, for a task you may have been doing in 60ms. On a 12–16GB card use fp8 weights with qwen3vl_4b_fp8_scaled and switch on unload_model; if you're cutting out hundreds of images, RMBG-2.0 or BiRefNet in the same pack is the sane batch choice and this is the one you wheel out for the hard twelve.
Soft edges on huge inputs. Inference happens at about 1MP. A 4K source comes back at 4K, but the alpha was decided on roughly an eighth of those pixels - crop and matte the region you care about if it's small in frame.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | RMBG-3.0 diffusion model loaded via Load Diffusion Model. | |
| clip | CLIP | Fibo 2.0 text encoder (qwen3vl_4b, type=fibo2) loaded via Load CLIP. | |
| vae | VAE | FLUX.2 VAE (flux2-vae.safetensors) loaded via Load VAE. | |
| image | IMAGE | Input image batch for RMBG-3.0 background removal. | |
| sensitivityopt | FLOAT | 1.000–1 | Adjust matte detection strength (lower values boost semi-transparent foreground). |
| mask_bluropt | INT | 00–64 | Gaussian blur radius for softening mask edges. |
| mask_offsetopt | INT | 0-64–64 | Expand (positive) or shrink (negative) the mask boundary in pixels. |
| invert_outputopt | BOOLEAN | false | Invert the output mask. |
| refine_foregroundopt | BOOLEAN | false | Fast foreground color estimation to remove edge color fringes. |
| unload_modelopt | BOOLEAN | false | Unload the RMBG-3.0 diffusion model from VRAM after execution (keeps CLIP and VAE cached). |
| stepsopt | INT | 41–20 | Sampling steps (RMBG-3.0 is distilled for 4 steps). |
| seedopt | INT | 00–18446744073709550000 | Random seed for sampling. |
| backgroundopt | COMBO | Alpha | Output format: Alpha for transparent PNG, or Color to composite against background. |
| background_coloropt | COLORCODE | #222222 | Hex background color used when background mode is set to Color. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |
| MASK_IMAGE | IMAGE | — |