🎭 S42 CutFlow Background Remover
Cut subjects out of video with BiRefNet, rembg, or a classic chroma key — all in one node
- images
- guidance_mask
- reference_bg
- result_rgb
- result_rgba
- mask
- info
Background removal is the most commoditized operation in this ecosystem - BiRefNet is the default, rembg is the old default, and everyone has a node for it. What makes S42 CutFlow Background Remover worth a look is that it bundles the whole toolbox into one node and adds two things most remover nodes don't have: temporal smoothing for video, and a guidance mask that lets you tell the model exactly which subject to keep.
The method dropdown is the front door, with 17 entries across three families:
- BiRefNet (
birefnet-general,-portrait,-massive,-general-lite,-hr,-dynamic,-matting) - the current state of the art, especially on hair, fur, and semi-transparency. The KB's BiRefNet panel calls it the ecosystem default, and ComfyUI even shipped it in core.-generalis the safe all-rounder;-portraitfor people;-hrfor big inputs (2048px). - rembg classics (
u2net,u2net_human_seg,u2netp,silueta,isnet-general-use) - the old reliable family. Slower per-frame, still fine for simple subjects. - Traditional (
chroma_green/blue/red,luma_key) - no AI at all, just color/brightness keying. These run on opencv alone and are the answer when your footage is already green-screened and you don't want to burn VRAM on a model.
Then the controls that matter:
use_gpu- on for AI methods (it's a model inference; the tooltip's "recommended" is accurate).processing_resolution(256–2048, default 1024) - inference resolution. 1024 is the sweet spot; 2048 is for BiRefNet_HR.mask_blur/mask_dilation/mask_erosion- the edge-quality trio.mask_blur0.8 softens edges naturally; dilate a couple px to grab stray hair, erode to kill background fringe. Dilation and erosion both default to 1, which means they roughly cancel - a sane starting point.temporal_smooth(0–5, default 0) - the video feature, and the one to actually use. AI masks flicker frame-to-frame as the model re-decides per frame; a window of 2–3 blends adjacent masks and kills the shimmer. On single images it does nothing, which is why it defaults to off.guidance_strength+guidance_mask(optional MASK) - the pack's signature twist. Paint white over the subject you want to keep, black everywhere else, and the AI output is gated by your mask: white lets the AI mask pass through, black is forced to zero. This is how you isolate one person out of a crowd when the model keeps grabbing all of them. The tooltip's instructions are clear - "paint white over the subject you want to KEEP" - andguidance_strengthat 1.0 means strictly keep-inside-white, 0 means ignore the mask entirely.reference_bg(optional IMAGE) - a clean background plate of the same scene; the remover uses it as difference info to find the subject. Pairs withS42CF BackgroundPlate.
Outputs are the useful spread: result_rgb (subject on black), result_rgba (with alpha channel, for compositing), mask (the MASK itself, for S42CF Subject Isolate or any mask-aware node), and info.
Now the honest part - dependencies and downloads. The BiRefNet methods need transformers and auto-download ~400MB of weights from HuggingFace on first use (cached after; if the download fails, check your firewall/proxy). The rembg methods need the rembg package. The traditional chroma/luma methods need nothing but opencv. The pack's requirements file only installs opencv, so the AI methods are genuinely optional - you'll know when ComfyUI tells you a package is missing. Also note the KB's finding: some BiRefNet auxiliary weight repos lack explicit license fields on their model cards; fine for personal use, worth a glance if you ship a product.
Installing it
S42-CutFlow install: ComfyUI Manager → search "S42 CutFlow" → Install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/GeekyGhost/S42-CutFlow.git
pip install -r S42-CutFlow/requirements.txt
Then, only if you want the AI methods: pip install rembg and make sure transformers is present (many packs already pull it). Traditional methods need neither.
The takeaway
For stills, any BiRefNet node does the job and this is a solid one. For video, the temporal_smooth plus guidance_mask combination is genuinely useful - those two knobs are why you'd pick this over the stripped-down remover you already have installed.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Image or video batch [B,H,W,C]. | |
| method | COMBO | birefnet-general | birefnet-general = best all-around AI. birefnet-portrait = people. birefnet-massive = highest quality. birefnet-hr = high-res 2048px. birefnet-dynamic = robust across resolutions. birefnet-matting = soft edges (hair, fur). u2net/isnet/silueta = classic AI (rembg). chroma_green/blue/red = screen keying. luma_key = brightness-based. |
| use_gpu | COMBO | yes | GPU for AI inference. |
| processing_resolution | INT | 1024256–2048 | AI inference resolution. 1024=standard, 2048=BiRefNet_HR. |
| mask_blur | FLOAT | 0.80–5 | Edge blur. 0=sharp, 0.8=smooth. |
| mask_dilation | INT | 10–10 | Expand mask N px. Helps with hair. |
| mask_erosion | INT | 10–10 | Shrink mask N px. Removes fringe. |
| remove_small_objects | INT | 3000–5000 | Remove noise < N px. Disabled for traditional methods. |
| invert_mask | COMBO | no | Swap foreground/background. |
| chroma_threshold | FLOAT | 0.120.01–0.5 | Chroma key sensitivity (chroma_* only). |
| chroma_softness | FLOAT | 0.080.01–0.3 | Chroma edge softness. |
| spill_suppress | FLOAT | 0.700–1 | Color spill suppression. |
| luma_mode | COMBO | shadows_highlights | What to KEEP. shadows=keep dark. highlights=keep bright. both=keep midtones. |
| shadow_threshold | FLOAT | 0.080–0.5 | Below = removed. Luma key only. |
| highlight_threshold | FLOAT | 0.920.5–1 | Above = removed. Luma key only. |
| luma_softness | FLOAT | 0.100.02–0.3 | Luma edge softness. Min 0.02 prevents freezes. |
| temporal_smooth | INT | 00–5 | Video mask smoothing window. 0=off, 1-5=flicker reduction. |
| guidance_strength | FLOAT | 1.000–1 | How hard the guidance mask gates the output. 0 = guidance ignored. 1.0 = strictly removes everything outside the white mask areas. Recommended: 1.0 for clean isolation. |
| guidance_maskopt | MASK | Paint white over the subject you want to KEEP. Leave everything else black. The BG remover will ONLY keep what's inside your white area. How it works: this mask GATES the AI output. White = AI mask passes through (subject kept). Black = forced to zero (guaranteed removed). | |
| reference_bgopt | IMAGE | Clean background plate. Enhances AI with difference info. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| result_rgb | IMAGE | — |
| result_rgba | IMAGE | — |
| mask | MASK | — |
| info | STRING | — |