Yogurt Sa2VA Video Segmentation
Segment every frame of a video with one text prompt
- sa2va_model
- images
- text_output
- masks
The image node is great, but the reason Sa2VA's "V" exists is video. Yogurt Sa2VA Video Segmentation takes a batch of frames, applies your one text prompt to all of them at once, and returns a mask per frame - no per-frame boxing, no tracking, no magic. You describe the object once ("the red car") and it follows it through the clip, which is exactly what you need to rotoscope a subject out of footage or build per-frame inpaint masks for a video-to-video workflow.
How it works
Mechanically it's the image node with the tensor iterated: every frame in the images batch becomes a PIL image, all of them get passed to Sa2VA's predict_forward as a video (video=[frame1, frame2, ...]) in one inference call, and the returned masks are converted to ComfyUI MASK tensors at the frame size. The same post-processing pipeline applies - threshold for binarization, then optional morph cleanup (opening/closing/erode/dilate with kernel sizes and iteration count).
Important reality check: Sa2VA segments per frame, it doesn't do temporal propagation like SAM2's video mode. There's no tracking memory carrying the object across frames - each frame is understood on its own. In practice that's usually fine because Sa2VA is good at this, but it means the cost scales linearly with frame count, and a long clip will eat a lot of VRAM and time. Feed it what you actually need, not the whole 10 minutes.
Inputs
sa2va_model- fromYogurt Sa2VA Model Loader. One load, all the frames.images- a batch of frames, i.e. any ComfyUIIMAGEthat's more than one frame. Load with a video loader (VHS / Load Video) or feed it frames from aLoad Imagebatch. The tooltip says it plainly: "Batch of images or video frames to segment."segmentation_prompt- the one description applied across every frame. Default is "Please provide segmentation masks for the objects in this video." Be specific; the model holds the whole sentence, so "the cyclist in the yellow jersey" works.threshold- probability → binary cutoff, 0.5 default. Same Qwen-series caveat as the image node: the slider only has teeth on patched Qwen models; others use the model's default binarization.morph+erode_kernel/dilate_kernel/iterations- per-frame cleanup.openingis your friend for killing single-frame sparkle noise.
Out: text_output (STRING) and masks (MASK, one per frame). Pipe the masks into the matching frame pipeline of your video compositor or inpaint chain, keeping the frame order aligned.
Install & gotchas
Pack-level install as always: clone into custom_nodes, pip install -r requirements.txt, restart. Models in ComfyUI/models/sa2va or auto-downloaded. The video node inherits the pack's three recurring sharp edges:
- Dropdown empty after copying models - no
config.jsonin the folder structure, or ComfyUI not restarted. - 8-bit fails to load -
bitsandbytesmissing; install or disableuse_8bit. - Memory - this is the hungriest node in the pack because it's a batch operation. If you're hitting OOM on a clip, drop the frame count, drop resolution, or let
use_8biteat the reload latency.
One more practical note: run it from a cached loader, not cold. With the reusable sa2va_model object this node is just frames-in, masks-out - which is the whole selling point of this fork over the version that reloaded Sa2VA per node.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| sa2va_model | YOGURT_SA2VA_MODEL | — | |
| images | IMAGE | Batch of images or video frames to segment. | |
| segmentation_prompt | STRING | Please provide segmentation masks for the objects in this video. | Text prompt describing what objects to segment across all frames. |
| threshold | FLOAT | 0.500–1 | Threshold for converting probability masks to binary masks. |
| morph | COMBO | none | 5 options: none, opening, closing, erode, dilate |
| erode_kernel | INT | 31–50 | — |
| dilate_kernel | INT | 31–50 | — |
| iterations | INT | 11–10 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text_output | STRING | — |
| masks | MASK | — |