A Gradio web interface for CorridorKey — the neural network green screen keyer by Niko Pueringer / Corridor Digital. This GUI adds interactive masking via SAM + MatAnyone video matting to create a complete keying pipeline from raw green screen footage to production-ready EXR sequences.
CorridorKey requires a coarse alpha hint mask for every frame. This GUI plugs in a smaller, lower-VRAM segmentation model (MatAnyone) to generate those hints automatically — click a few frames, and the rest is handled for you.
- SAM (Segment Anything) — Click on your subject to create a mask on any keyframe
- MatAnyone (~4-6 GB VRAM) — Propagates that mask across the entire video
- CorridorKey — Uses those propagated masks as hints to produce broadcast-quality alpha mattes and despilled foreground
The goal is to make CorridorKey's workflow accessible to people with 24 GB of VRAM (and eventually less) by keeping the hint generation stage lightweight.
- Multi-keyframe masking — Set SAM masks at multiple points in the video. Each segment gets a clean anchor, so the solver recovers from occlusions and motion blur
- Mask expansion — Dilate masks to preserve fine detail like hair and motion blur
- Interactive SAM — Positive and negative click points, multi-mask support, real-time preview
- Full Pipeline mode — One button: SAM mask → MatAnyone propagation → CorridorKey keying → EXR output
- Batch mode — Bring your own pre-made masks from Nuke/AE and just run CorridorKey
- Production color pipeline — Linear EXR output with premultiplied alpha, proper sRGB/linear conversions throughout
- GPU: NVIDIA GPU with CUDA support
- 24GB VRAM recommended (RTX 3090/4090) — runs all three models sequentially
- 12GB VRAM may work at reduced resolution — contributions welcome to optimize this
- Python: 3.10 or 3.11
- OS: Windows 10/11 (tested), Linux (should work)
git clone https://github.com/CodeBarrie/CorridorKey-GUI.git
cd CorridorKey-GUIpip install -r requirements-corridorkey.txt
pip install -r requirements-gui.txtClone MatAnyone into this directory and install as editable:
git clone https://github.com/pq-yang/MatAnyone.git
pip install -e ./MatAnyoneWindows note: You may need to remove
cchardet,PySide6, andpyqtdarkthemefrom MatAnyone'spyproject.tomlif they fail to build.
| Model | Size | Location |
|---|---|---|
| CorridorKey | ~400MB | CorridorKeyModule/checkpoints/CorridorKey.pth |
| SAM ViT-B | ~358MB | checkpoints/sam_vit_b.pth |
| MatAnyone | ~135MB | Auto-downloaded from HuggingFace on first run |
- CorridorKey weights: Obtain from nikopueringer/CorridorKey (not redistributed here)
- SAM weights: Download
sam_vit_b_01ec64.pthfrom facebookresearch/segment-anything and rename tosam_vit_b.pth
python app.pyOpens at http://localhost:7860. A public share link is also generated.
See WORKFLOW.md for the full step-by-step guide with settings reference, compositing tips, and troubleshooting.
- Go to Hint Generator tab
- Upload your green screen video
- Click on your subject to create a SAM mask (green = include, red = exclude)
- Switch to Full Pipeline tab and click Generate
- Keyed EXR sequence appears in
output/
- Load video in Hint Generator
- Use the frame slider to navigate to key moments
- Click SAM points and Save Keyframe at each
- Generate — each segment processes independently with its own anchor mask
If you already have alpha hint masks (from Nuke, AE, etc.):
- Go to Batch / Sequence tab
- Upload video + mask (image or video)
- Adjust CorridorKey settings and run
All output goes to output/ with timestamped subdirectories:
*_alpha.exr— Linear alpha matte*_fg.exr— sRGB foreground (straight/unpremultiplied)*_processed.exr— Linear premultiplied RGBA (ready for comp)*_comp.png— sRGB composite preview on checkerboard
Models load and unload sequentially to fit in VRAM:
- SAM (~1GB) — loaded during masking
- MatAnyone (~4-6GB) — loaded for hint generation, SAM unloaded first
- CorridorKey (~22GB at 2048px) — loaded for keying, MatAnyone unloaded first
This project exists as a starting point for the community to build on. Key areas for contribution:
- VRAM optimization — Making this work on 12GB or even 8GB GPUs by using MatAnyone's lighter model variants or reducing CorridorKey's processing resolution
- Performance — Batch inference, TensorRT, or other acceleration
- UI/UX — Better keyframe management, timeline scrubbing, preview modes
This project is non-commercial. Both CorridorKey and MatAnyone carry non-commercial licenses. Any derivatives must remain free and open source.
Created by Niko Pueringer / Corridor Digital. Licensed under CC BY-NC-SA 4.0.
- Code: github.com/nikopueringer/CorridorKey
- Commercial use requires agreement with contact@corridordigital.com
By Peiqing Yang et al. (CVPR 2025). Licensed under S-Lab License 1.0 (non-commercial use only).
By Meta AI Research. Licensed under Apache 2.0.
Licensed under CC BY-NC-SA 4.0 (matching CorridorKey's share-alike requirement). See LICENSE.
Built by CodeBarrie with Claude Code.