Load SAM2Matting Video Model
The one node that decides how fast your matting runs
- model
On the surface this is a boring loader: pick a variant, get a model handle. But it's the only node in the pack where you make a real decision, because the variant you choose here is the difference between a 40 FPS preview render and a nine-second-per-frame slog. Everything downstream in the SAM2Matting pack hangs off this model output, so it's worth sixty seconds to pick right.
What it actually does
It loads the official FudanCVL SAM2Matting temporal video predictor - the weights Fudan's lab trained for actual video matting, not per-frame segmentation - and hands it to you as a reusable SAM2MATTING_VIDEO_MODEL. You load it once and feed it to SAM2Matting Video, SAM2Matting Video Background (Streaming), or the SAM3 prompt node. On first use it downloads the checkpoint automatically to ComfyUI/models/sam2matting/ with a progress bar, so there's no separate model-hunting step. That first download is a couple of gigabytes; don't panic when the node hangs the first time you run it.
Picking the variant
Only two inputs exist, and one of them is a boolean, so the variant choice is the whole game:
sam2.1_base_plus- the default, and the right call for almost everyone. Solid quality on any subject, ~3.4–3.8 GB VRAM at 720p/1080p, roughly 30 FPS tracking.sam2.1_tiny- the fast preview pick. Slightly less crisp edges, but it runs ~40 FPS and barely sips VRAM. Use it to dial in your seed mask on a short clip, then swap to base_plus for the real render. That's the workflow, and it's a good one.sam3- the text-prompt tier, and the slow one. It's needed if you want to use SAM3 Text Prompt to Seed Mask instead of painting a mask. Expect ~9 FPS and a 4.8 GB+ VRAM footprint; the README asks for 24 GB+ system RAM. It also requires CUDA, so if you're on CPU or AMD-only, it's off the table entirely.
The compile_model trap
compile_model defaults to off, and you should leave it off until you understand what it costs. Compiling the image backbone can speed up repeated runs on a good GPU, but the first run after enabling it is substantially slower while it builds the compiled graph. It's a "tune when you're done with your workflow" button, not a first-run one.
Install
Search SAM2Matting Video in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/ethanfel/ComfyUI-SAM2Matting.git
cd ComfyUI-SAM2Matting
python -m pip install -r requirements.txt
Then restart ComfyUI. The nodes land under SAM2Matting/video. The pack's requirements.txt deliberately does not pin torch - ComfyUI owns that. The README is explicit: don't let the upstream research repo's pinned versions replace your working PyTorch install. The streaming nodes also need a modern ComfyUI with native VIDEO support (the core PyAV-based video nodes from 2025-era ComfyUI), so if you're on a very old ComfyUI, update it first.
Where people get burned
The upstream SAM2Matting project is CC BY-NC-SA 4.0 - non-commercial research terms. The SAM2.1 weights underneath are Apache 2.0, and SAM3 carries Meta's own custom SAM License. That's fine for your personal renders; it is not automatically fine if you ship a product or a paid service. Read the vendor/SAM2MATTING_LICENSE and THIRD_PARTY_NOTICES.md before you go commercial, and don't trust a blog post that says "SAM is open source" - that's true of SAM2, not of SAM3 or this checkpoint.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| variant | COMBO | sam2.1_base_plus | 3 options: sam2.1_base_plus, sam2.1_tiny, sam3 |
| compile_model | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | SAM2MATTING_VIDEO_MODEL | — |