Nodes/ComfyUI-GeekyRemB/Geeky RemB v4.0 - Ultimate AI Background Removal & Video Layering
ComfyUI Node

Geeky RemB v4.0 - Ultimate AI Background Removal & Video Layering

One node that cuts out your subject, drops it on a new background, and animates it — for better or worse

By GeekyGhost·Created 2 years ago·Updated about a year ago· 50
Geeky RemB v4.0 - Ultimate AI Background Removal & Video Layering
  • foreground
  • background
  • composite_result
  • foreground_mask
  • foreground_removed_bg
skip_background_removalfalse
removal_methodrmbg_v2_birefnet
chroma_colorgreen
chroma_tolerance0.15
chroma_softness0.8
spill_suppression0.9
position_modecenter
x_position0
y_position0
scale_x1.00
scale_y1.00
rotation0
blend_modenormal
opacity1.00
animation_typenone
animation_duration2.0
animation_amplitude100
easing_functionease_in_out_quad
anchor_x0.50
anchor_y0.50
flip_horizontalfalse
flip_verticalfalse
mask_blur1.5
edge_feathering3.0
remove_small_objectstrue
drop_shadowfalse
shadow_offset_x5
shadow_offset_y5
shadow_blur10
shadow_opacity0.50
animation_frequency1.0
animation_loops1
ping_pongfalse
start_delay0.0
video_fps24
total_frames0
processing_resolution1024
use_gpu_accelerationtrue
batch_processingtrue

If your only goal is to cut a person out of a photo, you don't need this node - ComfyUI ships BiRefNet natively these days, and a native Image Remove Background plus a composite node does the same job with fewer surprises. What GeekyRemB is actually for is the all-in-one move: feed it a foreground and a background, and it cuts the subject out, scales, rotates, repositions and blends it onto the new scene, even animates it across a frame sequence, all in a single pass. That's a workflow that normally takes four or five nodes. It's a kitchen sink, and like most kitchen sinks it does the core job well and lets the accessories get ahead of the marketing.

The honest read first

The README is a masterpiece of overstatement. "Multimodal processing", "physics-aware generation", "self-optimizing workflows" - none of that is in the shipped code. What's actually there is one node (GeekyRemB, ~950 lines) that wraps real models: BiRefNet for cutting, rembg's RMBG-1.4 as an alternative, and an OpenCV chroma keyer. Same story with the 15+ blend modes: in the source, only multiply, screen and overlay do their own math; the rest fall through to a plain alpha blend. Call it a comfortable wrapper, not a revolution, and you'll set your expectations right. The node itself is MIT, and the models underneath (BiRefNet, RMBG, rembg) are all open with no commercial gotchas.

How it works

Pick removal_method. The default rmbg_v2_birefnet (and birefnet_zhengpeng7) loads BiRefNet through HuggingFace transformers from the cocktailpeanut/rm repo, resizes your image to 1024 square internally, and upscales the mask back - which means the model caps how fine those hair edges can get no matter what processing_resolution you set. rmbg_v1_4_briaai uses rembg's ONNX session. chroma_key_advanced is pure HSV keying with spill suppression, and hybrid_ai_chroma blends a BiRefNet mask 70/30 with a chroma mask.

Then the compositor takes over: 12 position_mode choices, scale_x/scale_y, rotation, flips, opacity, and the animation_type/easing_function pair for motion over a frame batch. "Video" here means it loops over the batch dimension of your IMAGE tensor - pipe in frames from VHS Load Video and you get a batch of composited frames back. It's frame-consistent, not fancy.

The inputs that actually matter

  • foreground and background - both required IMAGE inputs. Nothing happens without both.
  • removal_method - the quality switch. BiRefNet for hard edges, RMBG-1.4 when you want speed, chroma key when you shot on a green screen.
  • skip_background_removal - set this when your foreground already has an alpha channel (e.g. from LayerDiffusion) and you only want compositing.
  • mask_blur / edge_feathering - your edge-quality levers; feather 2–5 for hair, leave the rest alone.
  • blend_mode / opacity - for compositing into the scene rather than just pasting.

Outputs are composite_result (the merged image), foreground_mask, and foreground_removed_bg (the cutout with alpha) - wire composite_result to Save Image and you're done.

Installing it

ComfyUI Manager, search "GeekyRemB", install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/GeekyGhost/ComfyUI-GeekyRemB.git
cd ComfyUI-GeekyRemB
pip install -r requirements.txt

Two install gotchas. First, the requirements file has onnxruntime-gpu>=1.16.0 listed with a comment saying "uncomment if using GPU" - but it's not commented, so a CPU-only machine will try to install the CUDA build and can fail at import. Swap it for plain onnxruntime if you have no GPU. Second, the first run downloads models: BiRefNet into your HuggingFace cache and the RMBG-1.4 ONNX into ~/.u2net. Give it a minute and let it finish - don't cancel.

Where people get burned

The big one is silent failure. If anything inside throws - model download fails, CUDA issue, weird input - the node catches it and returns your unprocessed background as the composite, so you get a result that looks fine and is completely wrong. Keep the ComfyUI console open on first run; the errors land there. Also note that because the mask output is built as an RGB image tensor, treating foreground_mask as a true single-channel MASK can misbehave downstream - prefer the foreground_removed_bg RGBA output for further compositing. And remember: 1024 is the BiRefNet ceiling here, so for 4K source you're still getting 1024-model edges. For a genuinely overengineered single node, it works surprisingly well for the cut-and-place workflow - just don't buy the "ultimate" part.

Categoryimage/video/background_removal

Inputs (41)

NameTypeDefaultDescription
foregroundIMAGE
backgroundIMAGE
skip_background_removalBOOLEANfalse
removal_methodCOMBOrmbg_v2_birefnet5 options: rmbg_v2_birefnet, rmbg_v1_4_briaai, birefnet_zhengpeng7, chroma_key_advanced, hybrid_ai_chroma
chroma_colorCOMBOgreen3 options: green, blue, red
chroma_toleranceFLOAT0.150–1
chroma_softnessFLOAT0.80–2
spill_suppressionFLOAT0.90–1
position_modeCOMBOcenter12 options: absolute_pixels, relative_percent, center, top_left, top_center, top_right, +6
x_positionFLOAT0-4000–4000
y_positionFLOAT0-4000–4000
scale_xFLOAT1.000.1–5
scale_yFLOAT1.000.1–5
rotationFLOAT0-360–360
blend_modeCOMBOnormal14 options: normal, multiply, screen, overlay, soft_light, hard_light, +8
opacityFLOAT1.000–1
animation_typeCOMBOnone22 options: none, slide_left, slide_right, slide_up, slide_down, slide_diagonal, +16
animation_durationFLOAT2.00.1–10
animation_amplitudeFLOAT1000–1000
easing_functionCOMBOease_in_out_quad8 options: linear, ease_in_quad, ease_out_quad, ease_in_out_quad, elastic_out, bounce_out, +2
anchor_xoptFLOAT0.500–1
anchor_yoptFLOAT0.500–1
flip_horizontaloptBOOLEANfalse
flip_verticaloptBOOLEANfalse
mask_bluroptFLOAT1.50–10
edge_featheringoptFLOAT3.00–20
remove_small_objectsoptBOOLEANtrue
drop_shadowoptBOOLEANfalse
shadow_offset_xoptFLOAT5-50–50
shadow_offset_yoptFLOAT5-50–50
shadow_bluroptFLOAT100–50
shadow_opacityoptFLOAT0.500–1
animation_frequencyoptFLOAT1.00.1–5
animation_loopsoptINT1-1–20
ping_pongoptBOOLEANfalse
start_delayoptFLOAT0.00–5
video_fpsoptFLOAT241–60
total_framesoptINT00–2000
processing_resolutionoptINT1024256–2048
use_gpu_accelerationoptBOOLEANtrue
batch_processingoptBOOLEANtrue

Outputs (3)

NameTypeDescription
composite_resultIMAGE
foreground_maskMASK
foreground_removed_bgIMAGE