Easiest Green Screen
The Green Screen You Get Without Buying a Green Screen
- images
- background_images
- image
- mask
The name is doing real work here. Traditional chroma keying means shooting against green, spill cleanup, despill math, a keyer that hates your hair. Easiest Green Screen skips all of it: it runs BiRefNet segmentation to find your subject, then composites the subject over a flat green (or blue, aqua, or white) background. No green screen needed - the green is painted in after the fact, so you can chroma-key anything you already have.
That's the trick worth understanding, because it changes what this node is for. You're not keying a real green screen shot - you're creating a green screen shot from arbitrary footage, so you can hand it to a downstream keyer, or just use the composite directly. It's the classic BiRefNet play (the model that displaced rembg for anything with hair, fur, or fabric edges) wrapped in a one-node convenience, with video batch support on top.
How it works
Feed it images (single image or batch). Inside:
- BiRefNet segments the foreground -
model_variantchooseslite(faster, less VRAM) orstandard(finer edge detail). resolution(fast 512 / balanced 768 / quality 1024) sets the segmentation processing size. Higher is sharper but heavier - this is the tradeoff that matters most.- The mask gets cleaned:
edge_refinefeathered the boundary (2–5 is the natural look, 0 is a hard edge),mask_expandgrows or shrinks it (positive keeps more subject, negative trims edge fringe). - The foreground is composited over the
bg_color- or overbackground_imagesif you wire any in, which overrides the color and auto-resizes to match (a single image broadcasts across the whole batch).
For video, temporal_smooth (0–15) averages the mask across neighboring frames to stop the mask from flickering - set 3–7 for subtle stability. That's the difference between a usable clip and a shimmering mess, and it's why this node is genuinely useful for footage, not just stills. Everything runs GPU-accelerated (the segmentation, the morphology, and the torch.lerp compositing).
Outputs: image (background replaced) and mask (white subject / black background) - keep the mask around if you want the alpha for a proper compositor later.
Install
Search "Trent Nodes" in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/TrentHunter82/TrentNodes.git
cd TrentNodes
pip install -r requirements.txt
This is the one node in the pack's image set with a real model behind it: BiRefNet runs through HuggingFace transformers (a pack requirement), and the weights download on first use. First run will stall for a bit; after that it's cached. Restart ComfyUI after installing. (The author has noted Manager install flakiness on this pack from an early repo rename - manual clone if Manager misbehaves.)
Common issues
- First run downloads a model. Give it a minute; it's a one-time thing.
- Fringed or eaten edges. Bump
resolutionup and feather withedge_refine; if you're losing the subject's edge, lowermask_expandtoward the negative. - Video mask flickers. That's what
temporal_smoothis for - it does nothing on single images, so don't be surprised if stills are unaffected. - Quality ceiling. BiRefNet is excellent but not perfect on semi-transparency (glass, veils). For those cases the finer
standardvariant atquality (1024)is the best this node can do - and that's quite good.
For "give me a clean chroma-keyable version of this footage," this is the one-click answer. The green screen is a lie, and that's exactly why it works.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Input image or image batch; backgrounds will be replaced with the selected chroma key color | |
| bg_coloropt | COMBO | green | Background replacement color: green and blue are standard chroma key colors |
| model_variantopt | COMBO | lite | BiRefNet model quality: lite is faster, standard gives finer edge detail |
| resolutionopt | COMBO | balanced (768) | Processing resolution for segmentation; higher gives sharper mask edges but uses more VRAM |
| edge_refineopt | INT | 20–20 | Gaussian feather radius in pixels for soft mask edges; 0 for hard edges, 2-5 for natural blending |
| mask_expandopt | INT | 0-20–20 | Grow or shrink the foreground mask boundary in pixels; positive expands foreground (keeps more), negative shrinks it (removes edge fringe) |
| temporal_smoothopt | INT | 00–15 | Temporal smoothing window for video batches; reduces mask flickering between frames. 0 = off, 3-7 = subtle, 9-15 = heavy. Has no effect on single images |
| background_imagesopt | IMAGE | Optional custom background image or batch; overrides bg_color when connected. Auto-resized to match input dimensions. A single image is broadcast to all frames |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Image with background replaced by the selected chroma key color |
| mask | MASK | Foreground mask from BiRefNet segmentation (white = subject, black = background) |