SAM3 - Video Masking via Text Prompts
SAM 3 lets you mask objects in a video just by typing a short phrase like "red car" or "person" — no frame-by-frame rotoscoping. It finds every matching instance, tracks them across frames with stable IDs, and outputs per-frame masks ready for compositing, blurring, or replacement.
简介
This workflow demonstrates text-driven video masking with the SAM3 Video Masking node (ID: 9cea40bb-b0cf-4b40-a758-8935cfe8d52f). You load a clip with VHS_LoadVideo, describe the target in plain language (for example, "red car", "person", "coffee cup"), and the node finds every matching instance and tracks them across frames with stable IDs. It produces three parallel outputs: a preview overlay (colored masks drawn over the original frames), a raw binary/gray mask stream, and a cut-out stream where only the masked pixels are kept.
你需要提供
- 正在读取工作流
在 ComfyUI 中运行。 此工作流无法在本页面运行。你可以在 Comfy Cloud 中打开(已预先加载所需内容),或下载后在自己的 ComfyUI 中使用。
在 Cloud 中试用常见问答
Connect each SAM3 output to its own SaveVideo node. Use VHS_LoadVideo’s fps output to drive the SaveVideo fps input (or set it manually), pick a file path and format, and render. You can export any or all of the streams independently.
Yes. If the prompt matches multiple instances (e.g., "person"), the node will segment and track each with stable IDs. To limit results, make the prompt more specific (e.g., "person in red jacket") or crop the input to the region of interest.
Rapid motion, motion blur, or heavy occlusion can reduce per-frame confidence and disrupt tracking. Improve results by using a more specific prompt, increasing the node’s confidence/score thresholds, and processing the original-resolution video (or less downscaling) if VRAM allows.
A GPU is strongly recommended. Performance scales with VRAM and compute capability. You can still prototype on limited hardware by lowering resolution and using VHS_LoadVideo’s frame_load_cap to preview a short segment before running the full clip.