SAM2Matting: Generalized Image and Video Matting

Choose a backbone (SAM2.1-Tiny / SAM2.1-Base+ / SAM3) and run image or video matting. Optionally provide a rough foreground mask; if omitted, one is auto-generated via Inspyrenet-Rembg.

Paper | GitHub | Model

Backbone
Background Color for Composite
Examples

Tips

  • Mask should roughly cover the foreground (white = foreground).
  • Soft grayscale masks work best.
  • SAM2.1-Tiny is fastest; SAM3 is heaviest (needs more VRAM/time).
  • Video matting uses the first-frame mask and propagates through the clip.
  • Keep Max frames modest on ZeroGPU Spaces.

License

CC-BY-NC-SA-4.0 (non-commercial research use only).