Matting Anything 2 logo

Matting Anything 2

Towards Video Matting for Anything · ICLR 2026

Official experimental weights for promptable video matting with points, boxes or masks. The main model uses Hiera Large, the Promptable Dual-mode Decoder (PDD), Memory-Separable Siamese (MSS) and rank-16 LoRA adapters. MEMatte refines RGB and the predicted trimap into an alpha matte.

Checkpoints

File Description Size
mam2_main.pt Original experimental checkpoint_100.pt 1,035,483,060 bytes
mam2_matter.pth Associated MEMatte refinement weights 116,874,309 bytes

Both files preserve the original checkpoint bytes. Their SHA-256 hashes and sizes are recorded in weights.json and SHA256SUMS. The inference configuration pins weight revision 0e0a8d0d9034b00c4baca88f1a0bb1397e724905.

Use with the MAM2 source release

Install the Matting Anything 2 source project in a dedicated Python environment:

python -m pip install -e '.[demo]'

The source release provides the modified SAM2 package, PDD, MSS, MEMatte and the configuration loader. Download and verify the weights with:

mam2-download --config configs/inference.yaml

Launch the interactive demo:

CUDA_VISIBLE_DEVICES=0 OMP_NUM_THREADS=4 \
mam2-demo --config configs/web.yaml

Open http://127.0.0.1:7860, choose a video, add points or a box, and start matting. The inference CLI uses the same checkpoint configuration:

CUDA_VISIBLE_DEVICES=0 mam2-infer --config configs/inference.yaml \
  input.source=inputs/example.mp4 \
  inference.matter_max_size=2048

Both entry points download the weights on first use and reuse the cache. Public downloads require no login. For offline use after downloading, set huggingface.local_files_only=true with the same cache and revision. Configuration files are included under configs/.

Attribution

The main model is based on SAM2. The refinement checkpoint is the MEMatte weight used with the original MAM2 experiments. Source attribution and code licenses are provided with the MAM2 source release.

Citation

@inproceedings{zhang2026mattinganything2,
  title={Matting Anything 2: Towards Video Matting for Anything},
  author={Zhang, Chenyi and Lin, Yiheng and Wei, Yunchao and Wang, Hongsong and Shan, Caifeng and Zhao, Fang},
  booktitle={International Conference on Learning Representations},
  year={2026}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support