logo
RunComfy
  • ComfyUI
  • TrainerNew
  • Models
  • API
  • Pricing
discord logo
ComfyUI>Workflows>CorridorKey ComfyUI | Guided Video Keying Tool

CorridorKey ComfyUI | Guided Video Keying Tool

Workflow Name: RunComfy/CorridorKey-ComfyUI
Workflow ID: 0000...1387
This guided workflow helps you extract clean video foregrounds with precise control. Designed for editors and compositors, it refines coarse masks into smooth mattes. You can accurately separate subjects from complex scenes without edge artifacts. Built for live-action editing, it enhances compositing clarity and saves cleanup time. Perfect for creators seeking production-ready keying results with adjustable matting responsiveness.

CorridorKey ComfyUI: Guided Video Keying and Matting

This CorridorKey ComfyUI workflow turns a source video plus a coarse mask pass into clean foreground plates, a high-quality matte, and review previews for fast iteration. It is a controllable, editor-friendly keying pipeline built around the CorridorKey custom node and model, intended for live-action shots where you want precision and stability rather than a one-click background remover.

The graph ships with four deliverables: a foreground-only plate, a grayscale matte, a processed preview, and a QC overlay. It keeps your original frame rate for seamless round-tripping into NLEs and compositors. The CorridorKey ComfyUI node is provided by SeanBRVFX/ComfyUI-CorridorKey and loads weights from nikopueringer/CorridorKey_v1.0.

Key models in Comfyui CorridorKey ComfyUI workflow

  • CorridorKey v1.0. A guided keying model that refines a user-supplied coarse mask into a detailed, temporally consistent matte across frames. It focuses on retaining fine structures such as hair and motion-blurred edges while minimizing halos and holes. Model weights are hosted on Hugging Face for streamlined use inside ComfyUI.

How to use Comfyui CorridorKey ComfyUI workflow

This workflow takes two aligned clips of identical duration, resolution, and fps: your source plate and a coarse mask pass. It then converts the mask frames to a single-channel matte, runs CorridorKey to refine per-frame alphas, and assembles four synchronized review outputs.

Stage 1 — Load footage and mask

Load your source plate in LoadVideo (#26) and a matching coarse mask clip in LoadVideo (#29). The two clips must match in frame count, fps, and dimensions to ensure perfect sync. A coarse mask can be a rough roto, a thresholded pass, or any region-of-interest matte that covers the subject with some tolerance. Keeping the mask temporally stable, even if rough, makes the refinement more consistent shot to shot.

Stage 2 — Split frames and prep the mask

Both videos are unpacked to frames and fps using GetVideoComponents (#27, #30). The mask clip is converted to a single-channel matte with ImageToMask (#31). By default the node reads the red channel, which suits masks encoded as solid red graphics; switch the channel if your mask is grayscale or keyed to green or blue. Aim for a mask that includes all subject detail but avoids large background regions to reduce false positives later.

Stage 3 — Guided keying with CorridorKey

Frames from the source plate feed the image input and the converted matte feeds the mask input of CorridorKey (#28). The model refines edges, fills small holes, and balances detail retention against noise, using the coarse mask as strong spatial guidance. It emits four outputs per frame: fg for the foreground plate, matte for the refined alpha, processed for a straightforward visual preview, and QC for an at-a-glance overlay that highlights problem areas. Use QC to spot halos, transparency errors, or edge chatter before committing to exports.

Stage 4 — Assemble and save deliverables

The refined streams are turned back into videos while inheriting the original fps. CreateVideo (#33) builds the foreground plate from fg and SaveVideo (#32) writes it to disk. The matte mask is converted to viewable frames with MaskToImage (#35), then exported via CreateVideo (#34) and SaveVideo (#36) as a grayscale reference. The processed and QC branches are likewise assembled with CreateVideo (#37, #39) and saved using SaveVideo (#38, #40) for quick review and shot-to-shot quality checks.

Key nodes in Comfyui CorridorKey ComfyUI workflow

CorridorKey (#28)

This is the centerpiece that transforms a rough guide into a production-ready matte and foreground. Treat the guide mask as the main steering signal: if it is too tight you may clip hair and motion blur, and if it is too loose the key can creep into the background. Keep your input color space consistent across the plate and mask, and rely on the QC output to judge edge integrity before exporting. When refining tricky shots, iterate on the coarse mask rather than over-tweaking downstream steps.

ImageToMask (#31)

This node extracts a single-channel matte from the mask clip. Match its channel selector to how your mask is encoded, for example red for solid-red graphics or the appropriate channel for color-coded mattes. If your mask is grayscale, select the luminance-appropriate channel so white represents subject and black represents background. A clean binary or near-binary input here greatly improves CorridorKey’s stability.

Optional extras

  • Ensure both inputs share identical fps, resolution, and frame count to avoid drift or frame slips in the outputs.
  • Prefer constant-frame-rate sources and avoid letterboxing or pillarboxing in either input clip.
  • If you see halos in QC, expand the coarse mask slightly and re-run; if edges look choked, loosen the mask just enough to include wisps and motion blur.
  • Export both the foreground plate and the matte; in your NLE or compositor, use the matte as the alpha for the foreground plate for exact control.
  • For batch work, keep your mask naming and encoding consistent so ImageToMask does not require per-shot changes.

Links

  • CorridorKey custom node: SeanBRVFX/ComfyUI-CorridorKey
  • CorridorKey model weights: nikopueringer/CorridorKey_v1.0

Acknowledgements

This workflow implements and builds upon the following works and resources. We gratefully acknowledge SeanBRVFX for ComfyUI-CorridorKey and nikopueringer for CorridorKey_v1.0 for their contributions and maintenance. For authoritative details, please refer to the original documentation and repositories linked below.

Resources

  • SeanBRVFX/ComfyUI-CorridorKey
    • Source repo: SeanBRVFX/ComfyUI-CorridorKey
  • nikopueringer/CorridorKey_v1.0
    • Model source: nikopueringer/CorridorKey_v1.0

Note: Use of the referenced models, datasets, and code is subject to the respective licenses and terms provided by their authors and maintainers.

Want More ComfyUI Workflows?

MatAnyone Video Matting | Single Mask Removal

Remove video backgrounds with one mask frame for perfect subject isolation.

Wan Alpha | Transparent Video Generator

Alpha magic: instant transparent background videos for VFX and design.

ComfyUI Grounding | Object Tracking Workflow

Track any subject with pixel-perfect accuracy for stunning VFX results.

Segment Anything V2 (SAM2) | Video Segmentation

Object segmentation of videos with unrivaled accuracy.

DiffuEraser | Video Inpainting

Erase objects from videos with auto-masking and realistic reconstruction.

AnimateLCM | Speed Up Text to Video

Accelerate your text-to-video animation using the ComfyUI AnimateLCM Workflow.

ComfyUI F5 TTS | Natural Voice Cloning Engine

Turn text into rich, expressive voices with natural tone control.

AnimateDiff + ControlNet | Marble Sculpture Style

Transform your videos into timeless marble sculptures, capturing the essence of classic art.

Follow us
  • LinkedIn
  • Facebook
  • Instagram
  • Twitter
Support
  • Discord
  • Email
  • System Status
  • Affiliate
Resources
  • Free ComfyUI Online
  • ComfyUI Guides
  • RunComfy API
  • ComfyUI Tutorials
  • ComfyUI Nodes
  • Learn More
Legal
  • Terms of Service
  • Privacy Policy
  • Cookie Policy
RunComfy
Copyright 2026 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.