Background Removal (Preserve Alpha)
Cutouts that keep their soft edge (and skip the model when you already have alpha)
- image
- background_removal_model
- background_options
- RGBA Image
- Alpha Mask
Background removal in 2026 is the most commoditized operation in the whole ecosystem, and BiRefNet is the default - it's so dominant that ComfyUI shipped it into core. Most remove-background nodes give you a hard mask and a jpeg-ish result. This one does the thing that's actually useful for compositing: it returns source-resolution RGBA images and their soft alpha masks, and it refuses to wreck an alpha channel that already exists.
The headline trick is in the laziness. If you feed it an image that already has an alpha channel, it does not run a model at all - the existing RGBA is passed through with its alpha preserved exactly, so a cutout you already made doesn't get re-segmented and re-edged. RGB input is where the work happens: it runs a background-removal model, keeps the soft mask, and emits RGBA plus the matching Alpha Mask. Original RGB values stay stored beneath the transparent pixels, which is a detail that saves your ass later when you need to re-composite.
Which model? The background_removal_model_name dropdown defaults to birefnet, with lucida as the alternative, and both load from ComfyUI's background_removal model folder. Or you can connect a Core background_removal model socket directly and it overrides the selector entirely. The background_options socket is optional and comes from the pack's staged-compositor options - it lets you apply mask threshold, processing resolution, border/artifact cleanup, gap fill, feathering, and mask resizing before the RGBA comes out.
The one real gotcha is the model file. If birefnet.safetensors (or lucida.safetensors) isn't sitting in ComfyUI/models/background_removal/, the node doesn't silently download it - it throws an error that helpfully tells you exactly where to fetch it from (Comfy-Org/BiRefNet on HuggingFace). It's a single file drop, so the fix is 60 seconds:
ComfyUI/models/background_removal/birefnet.safetensors ← from Comfy-Org/BiRefNet
ComfyUI/models/background_removal/lucida.safetensors ← if you want the lucida option
Anything in background_options that touches processing resolution matters for quality on hard edges: hair and fur are exactly where BiRefNet earned its reputation, and the cleanup stages (border strip removal, morphological open/close, feather) are what turn a decent mask into a compositing-grade one. The KB's advice on picking a remover applies here too: choose by which failure you can tolerate. BiRefNet is the solid default; if you're on constrained hardware, Lucida is the lighter alternative.
Where this fits in a workflow: feed it the output of any generator, get RGBA + mask, and hand both to the pack's layered compositor or your own inpaint/upscale chain. Because it keeps source resolution, there's no upscale-after-crop dance. Install is pack-standard - Manager search "ComfyUI-UtilsCollection" or git clone - and the only download is that one model file.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| background_removal_model_name | COMBO | birefnet | Internal model used when background_removal_model_opt is disconnected. |
| background_removal_modelopt | BACKGROUND_REMOVAL | Optional Core background-removal model. When connected it overrides the internal BiRefNet/Lucida selector. | |
| background_optionsopt | UC_STAGED_LAYERED_BACKGROUND_OPTIONS | Optional staged-compositor mask settings. Applies threshold, processing resolution, border cleanup, artifact cleanup, gap fill, feather, and mask resizing. RGBA inputs still preserve their embedded alpha exactly. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| RGBA Image | IMAGE | — |
| Alpha Mask | MASK | — |