Nodes/S42 CutFlow/🎭 S42 CutFlow Background Remover
ComfyUI Node

🎭 S42 CutFlow Background Remover

Cut subjects out of video with BiRefNet, rembg, or a classic chroma key — all in one node

By GeekyGhost·Created 6 months ago·Updated 4 months ago· 3
🎭 S42 CutFlow Background Remover
  • images
  • guidance_mask
  • reference_bg
  • result_rgb
  • result_rgba
  • mask
  • info
methodbirefnet-general
use_gpuyes
processing_resolution1024
mask_blur0.8
mask_dilation1
mask_erosion1
remove_small_objects300
invert_maskno
chroma_threshold0.12
chroma_softness0.08
spill_suppress0.70
luma_modeshadows_highlights
shadow_threshold0.08
highlight_threshold0.92
luma_softness0.10
temporal_smooth0
guidance_strength1.00

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. -general is the safe all-rounder; -portrait for people; -hr for 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_blur 0.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" - and guidance_strength at 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 with S42CF 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.

CategoryS42 CutFlow/Expanded

Inputs (20)

NameTypeDefaultDescription
imagesIMAGEImage or video batch [B,H,W,C].
methodCOMBObirefnet-generalbirefnet-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_gpuCOMBOyesGPU for AI inference.
processing_resolutionINT1024256–2048AI inference resolution. 1024=standard, 2048=BiRefNet_HR.
mask_blurFLOAT0.80–5Edge blur. 0=sharp, 0.8=smooth.
mask_dilationINT10–10Expand mask N px. Helps with hair.
mask_erosionINT10–10Shrink mask N px. Removes fringe.
remove_small_objectsINT3000–5000Remove noise < N px. Disabled for traditional methods.
invert_maskCOMBOnoSwap foreground/background.
chroma_thresholdFLOAT0.120.01–0.5Chroma key sensitivity (chroma_* only).
chroma_softnessFLOAT0.080.01–0.3Chroma edge softness.
spill_suppressFLOAT0.700–1Color spill suppression.
luma_modeCOMBOshadows_highlightsWhat to KEEP. shadows=keep dark. highlights=keep bright. both=keep midtones.
shadow_thresholdFLOAT0.080–0.5Below = removed. Luma key only.
highlight_thresholdFLOAT0.920.5–1Above = removed. Luma key only.
luma_softnessFLOAT0.100.02–0.3Luma edge softness. Min 0.02 prevents freezes.
temporal_smoothINT00–5Video mask smoothing window. 0=off, 1-5=flicker reduction.
guidance_strengthFLOAT1.000–1How 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_maskoptMASKPaint 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_bgoptIMAGEClean background plate. Enhances AI with difference info.

Outputs (4)

NameTypeDescription
result_rgbIMAGE
result_rgbaIMAGE
maskMASK
infoSTRING