CorridorKey Green Screen Keyer
Green screen keying that keeps the hair, not the halo
- images
- mask
- background_images
- composite
- alpha_matte
- foreground
Traditional chroma keying makes a binary decision per pixel: green or not green. That's why hair, motion blur, and out-of-focus edges come out as green fringes and hard halos. CorridorKey - the neural keyer from Corridor Digital, the VFX YouTube studio - takes a different route: it doesn't decide "is this green," it unmixes the true foreground color from the green background, so a semi-transparent wisp of hair keeps its actual color instead of becoming a matte-shaped hole. This node wraps that model for ComfyUI and, like the best background-removal tooling in the ecosystem, it rides on BiRefNet for the parts it doesn't do itself.
Here's the flow under the hood, and it's a good example of the pack's VRAM discipline. If you don't provide a mask, BiRefNet auto-generates an alpha hint per frame - then it's freed from VRAM before the CorridorKey model loads, because CorridorKey needs its own ~3–5GB. The keyer then produces three things: a clean straight (un-premultiplied) foreground with the green removed, a linear alpha matte, and a composite over your chosen background. "Straight foreground" matters if you're re-compositing elsewhere - it's the professional delivery form, not a pre-multiplied RGB-into-alpha mess.
What you set
images- required green-screen footage; processed per frame.mask- optional alpha hint / garbage matte. Skip it and BiRefNet does the work (it's in ComfyUI core, MIT, the default cutout model of the ecosystem).bg_color-green,blue,aqua,white,black,transparent(RGBA output), ornone(returns originals unchanged). Defaultgreen.background_images- optional custom background; overridesbg_colorwhen connected, auto-resized, single image broadcast to all frames.refiner_scale- the CNN refiner strength; 1.0 standard, higher pushes edge detail at artifact risk.despill_strength- green spill removal, 1.0 = full despill. This is the "no more green rim on the shoulders" knob.input_is_linear- enable for linear-space EXR input; default assumes sRGB/REC709 camera footage.auto_despeckle+despeckle_size- auto-removes small disconnected alpha blobs like tracking markers (default 400 px min area).edge_refineandmask_expand- Gaussian feather radius and grow/shrink of the matte.
Outputs: composite (RGBA when bg_color=transparent), alpha_matte, and foreground - each tooltip-described as straight color, linear matte, and recomposable foreground respectively.
The model download and gotchas
The CorridorKey weights (~300MB) auto-download from HuggingFace on first use, and it needs timm + einops (in the pack's requirements) for the Hiera backbone. First run pays the download and the VRAM swap; expect a pause while BiRefNet frees up before CorridorKey loads.
Two things to check when the matte looks wrong: if hair edges go hard, lower refiner_scale slightly rather than cranking edge_refine - feather fixes are cosmetic, the refiner is structural. And if you're keying footage shot in a log or linear pipeline, forgetting input_is_linear gives you a green-tinted, muddy matte; flip it on for EXR. The pack's requirements also pull transformers for BiRefNet, so a pre-existing ComfyUI with a pinned transformers version can see the usual version dance - Manager handles most of it, and pip install -r requirements.txt sorts the rest.
Install: ComfyUI Manager (search "Trent Nodes"), or git clone https://github.com/TrentHunter82/TrentNodes into custom_nodes/ + pip install -r requirements.txt. This is one of the pack's heavyweight nodes - it earns the download, and for hair-heavy green screen work it beats the classic keyers by a visible margin.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Green screen footage (image batch); CorridorKey unmixes foreground color from the green background per frame | |
| maskopt | MASK | Alpha hint / garbage matte; rough black-and-white mask isolating the subject. If not provided, BiRefNet auto-generates one per frame | |
| bg_coloropt | COMBO | green | Background color for composite output; 'transparent' outputs RGBA with alpha embedded; 'none' returns original images unchanged |
| background_imagesopt | IMAGE | Optional custom background; overrides bg_color when connected. Auto-resized to match input. Single image is broadcast to all frames | |
| refiner_scaleopt | FLOAT | 1.00–2 | CNN refiner strength; 1.0 is standard. Higher pushes edge detail but may introduce artifacts |
| despill_strengthopt | FLOAT | 1.00–2 | Green spill removal; 1.0 is full despill, 0.0 disables. Removes green fringing on edges and translucent areas |
| input_is_linearopt | BOOLEAN | false | Enable if input is linear color space (EXR). Default assumes sRGB/REC709 camera footage |
| auto_despeckleopt | BOOLEAN | true | Auto-remove small disconnected alpha regions like tracking markers and background noise |
| despeckle_sizeopt | INT | 4000–2000 | Minimum pixel area to keep; alpha regions smaller than this are removed. Higher = more aggressive cleanup |
| edge_refineopt | INT | 00–10 | Gaussian feather radius for soft matte edges; 0 = sharp edges from CorridorKey |
| mask_expandopt | INT | 0-20–20 | Grow or shrink the matte boundary; positive expands foreground, negative shrinks |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| composite | IMAGE | Foreground composited over the selected background color or custom background; RGBA (4-channel) when bg_color=transparent |
| alpha_matte | MASK | Clean linear alpha matte from CorridorKey (white = foreground) |
| foreground | IMAGE | Straight (un-premultiplied) foreground color with green screen removed; useful for re-compositing in other tools |