Nodes/ComfyUI-CorridorKeyWrapper/CorridorKey Greenscreen
ComfyUI Node

CorridorKey Greenscreen

Neural keying that un-mixes color, not just cutouts

By pixelworldai·Created 5 months ago·Updated 3 months ago· 2
CorridorKey Greenscreen
  • ck_model
  • image
  • alpha_hint
  • alpha
  • foreground
  • processed_rgba
  • comp_preview
despill_strength1.0
refiner_scale1.00
auto_despeckletrue
despeckle_size400
input_is_linearfalse

This is the node the pack exists for. CorridorKey Greenscreen takes the loaded model, your green-screen plate, and a rough alpha hint from Chroma Key Prepass - and returns a proper key: a clean alpha matte, a despilled foreground, an RGBA image, and a checkerboard preview. Where a chroma keyer and a background-removal model (BiRefNet, RMBG, the whole segmentation family) both guess "is this pixel foreground or background?", CorridorKey instead tries to reconstruct what each pixel's color was before the screen light contaminated it.

That distinction is the whole reason people put up with the weight and setup. Segmentation models collapse to a hard silhouette and chew up semi-transparent pixels - motion blur, out-of-focus edges, hair, glass, smoke. CorridorKey predicts a true straight (unmultiplied) color and a clean linear alpha for every pixel, "as if the green screen was never there," which is why you can drop the result over a new background without the telltale black fringe or green halo at the edges. It's the matting-vs-segmentation gap, solved at the network level instead of patched in post.

How it works

Per frame, the node calls the engine's process_frame with your plate and hint, then does the color plumbing itself. The engine runs on a native 2048px backbone and scales internally for bigger plates, so it's resolution-independent up to 4K. The outputs are handled carefully: alpha stays linear, the foreground is un-premultiplied from the processed RGBA and converted to sRGB, the RGBA output is straight (not premultiplied) sRGB, and the comp preview is a checkerboard composite you can eyeball without compositing over anything.

Inputs and outputs

Three required inputs: ck_model (from Load CorridorKey Model), image (your plate), and alpha_hint (a MASK - from Chroma Key Prepass or anywhere else). The optional set is where you spend your tuning time:

  • despill_strength (1.0, 0–10): green spill removal. 0 means no despill at all.
  • refiner_scale (1.0, 0–2): multiplier on the CNN refiner; 0.0 disables it. Your speed/VRAM lever - drop it to 0 when the refiner's cost isn't worth it on simple plates.
  • auto_despeckle (true): removes small disconnected alpha islands - tracking markers, noise.
  • despeckle_size (400): minimum pixel area to keep when despeckling. If the cleanup is eating small legit details, lower it.
  • input_is_linear (false): set true only if your plate is genuinely linear, e.g. from an EXR loader. Leave it false for normal sRGB PNG/JPG footage; this is the one that quietly ruins results when flipped by accident.

The four outputs, and where they go:

  • alpha (MASK) - the clean matte.
  • foreground (IMAGE) - despilled straight sRGB subject.
  • processed_rgba (IMAGE) - straight RGBA in sRGB; save this if you want a PNG with transparency.
  • comp_preview (IMAGE) - checkerboard composite for previewing.

Wire foreground + alpha into CorridorKey Composite over your new background, or take processed_rgba straight to a Save Image node.

Batching and speed

The node loops frame by frame with a progress bar, so a loaded video clip keys in one pass. It's not fast - the engine is heavy, and the refiner doubles down on the cost. Batch a short clip first to confirm the hint works, then let the long run go unattended. That's the workflow the community actually describes: slow but reliable, best left running overnight for long footage.

Troubleshooting

  • Black or green edges on the result: you're compositing in the wrong color space. If you bypass CorridorKey Composite and use a plain Image Composite node, you're blending gamma-encoded pixels and the edges will betray you. Use the pack's composite node, or anything else linear-aware.
  • Subject looks eroded or clipped: your hint is too tight. The prepass's erode/blur defaults exist to pull the hint off edges - if you replaced it with a laser-sharp roto, the model may trust the boundary too much.
  • Small details flickering out: that's the despeckle. Lower despeckle_size.
  • Despill washing out the subject: cut despill_strength toward 0.5.

Install

Same pack as the rest - ComfyUI Manager, search ComfyUI-CorridorKey, or:

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

The ~300MB checkpoint auto-downloads to ComfyUI/models/corridorkey/ on first use. VRAM is the real system requirement - see the Load CorridorKey Model page for the honest numbers.

CategoryCorridorKey

Inputs (8)

NameTypeDefaultDescription
ck_modelCK_MODEL
imageIMAGE
alpha_hintMASK
despill_strengthoptFLOAT1.00–10Strength of green spill removal. 0 = no despill.
refiner_scaleoptFLOAT1.000–2Multiplier for the CNN refiner. 1.0 = default, 0.0 = disable refiner.
auto_despeckleoptBOOLEANtrueRemove small disconnected alpha islands (tracking markers, noise).
despeckle_sizeoptINT4000–10000Minimum pixel area to keep when despeckling.
input_is_linearoptBOOLEANfalseSet True if your input image is in linear color space (e.g. from EXR loader).

Outputs (4)

NameTypeDescription
alphaMASK
foregroundIMAGE
processed_rgbaIMAGE
comp_previewIMAGE