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.

Technically, the node performs text-conditional object detection and segmentation per frame, then links detections across time to keep IDs stable. VHS_LoadVideo supplies the frame sequence and fps; SaveVideo writes each output stream to disk. For quick iteration, the frame_load_cap parameter on VHS_LoadVideo lets you limit how many frames are processed; set it back to 0 for a full run. A MarkdownNote node in the graph provides inline reminders for prompt writing and testing.

API

Use this workflow from code

Every Comfy workflow is a JSON graph. The payload below is this workflow, exactly as ComfyUI runs it — fetch it from the URL, keep it in version control, or load it in ComfyUI and run it node by node.

GET https://comfy.org/workflows/download/0a6672ca248d.json
Fetching workflow JSON…

Run it from Python or TypeScript with the Comfy SDK. The same code targets Comfy Cloud or a ComfyUI you host yourself — only the base URL changes.

# Install (beta)
pip install comfy-sdk        # Python
npm i @comfyorg/sdk          # TypeScript

# Run this workflow (Python)
from comfy_sdk import Comfy

client = Comfy(api_key="comfyui-...")
wf = client.workflows.from_file("workflow_api.json")
job = client.run(wf)
for output in job.get_outputs("<output-node-id>"):
    output.to_file(output.name)

The SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API). API access requires a Comfy Cloud plan with an API key. SDK docs · Get an API key

FAQ

Frequently Asked Questions

View all workflows
Character
Cinematic
Image to Video
Lip Sync
Multiple Angles
Portrait
Style Reference
Style Transfer
Text to Video
Video Generation
Video
Showing 30 of 30 templates