cvlab-kaist/VideoMaMa
Official implementation of "VideoMaMa: Mask-Guided Video Matting via Generative Prior", CVPR 2026
What it solves
Video matting is the task of extracting a precise foreground (e.g., a person or object) from each video frame, including accurate edges and fine details like hair or fur. Traditional methods often struggle with video domains they haven't seen before, producing unstable or coarse results. VideoMaMa addresses this by using a video generative prior—knowledge from a video diffusion model—to guide the matting process, leading to more stable and detailed matting across a wide range of video content.
How it works
The framework takes an input image and a user-provided mask (a rough outline of the foreground) as guidance. It uses Stable Video Diffusion (a pre-trained video generation model) as the generative prior, and incorporates SAM2 (Segment Anything 2) for training the matting head. The model output is a fine-grained alpha matte that separates foreground from background with precise edges. The repository includes scripts for setup, inference (using a single command), and training, along with a Hugging Face demo.
Who it's for
Researchers and developers working on video editing, VFX, or any application requiring high-quality automatic foreground extraction. It is also useful for those interested in leveraging generative models for vision tasks. The project provides code, checkpoints, and an interactive demo, making it accessible for both experimentation and integration.
Highlights
- Leverages a video generative prior from Stable Video Diffusion for robust matting across diverse domains.
- Fine-grained matting quality preserving details like hair and edges.
- Includes pre-trained model checkpoint on Hugging Face and an interactive web demo.
- Provides full training code and data pipeline documentation.
- Integrated into third-party tools like ComfyUI, CorridorKey, and Sammie-Roto-2.
- Published at CVPR 2026 with an open-source release under CC BY-NC 4.0 (code) and Stability AI community license (checkpoints).
Related
- Project
- Project
- Project
- Project