CS Video Segment (SeC-4B)
SAM2 tracks how things look. This node tracks what they are.
- model
- images
- video_input
- MASK
- anchor_mask
- video_info
The classic complaint with SAM2-style video tracking is that it follows the pixels, not the person. Someone walks behind a pillar and re-emerges in a different jacket, and your "track" is gone. CS Video Segment (SeC-4B) is the CineStyle pack's answer: it runs OpenIXCLab's SeC-4B, a model that builds on a vision-language model to understand what an object is, then uses a built-in LongSAM2.1 video memory encoder to carry that concept through the whole clip - through occlusions, lighting changes, even the jacket swap. People who've switched describe it as "track this concept" instead of "track this shape."
Where do you use it? The same places you'd use a video mask: feeding an object mask into a motion/pose-driven workflow (Wan-Animate-style pipelines are the usual suspects), product/logo swaps, or isolating a character across a scene for targeted editing. The KB's sam.json panel calls SAM3 the current mainstream tier - this is the differentiator tier.
How it works
Wire a CS SeC-4B Model Loader into model. Point the node at your video via images (an IMAGE batch) or video_input (a VIDEO; images wins if both are connected). Click Open Selector, drop prompts on one anchor frame - rough mask, BBoxes, positive/negative points, multiple objects - then execute. SeC-4B segments that frame, and the LongSAM2.1 memory propagates the mask frame-by-frame in your chosen direction. By default the node unloads SeC-4B's sub-models after execution to free VRAM, and reloads them on the next run.
The inputs that matter
model- theSEC_MODELfrom the loader. Required.images/video_input- your video source. At least one must be connected or the node refuses to run.anchor_frame- which frame your prompts live on (0-based). The Selector usually writes this for you.tracking_direction-bidirectional(default),forward, orbackward. Bidirectional is the safe default.max_frames_to_track--1means "to the end of the video." Set a number to cap per-direction propagation.mllm_memory_size(default 12) - how many historical key frames the model keeps for concept memory on scene changes. More = more robust, more VRAM.offload_video_to_cpu- off, on by default. On it trades speed for VRAM headroom.auto_unload_model- on by default; the VRAM releaser.
One thing you'll not find: a semantic-prompt tab. The Selector shows Semantic only for the SAM3 node. SeC uses Draw Mask / Edit BBox / Edit Point - if you hand it a text prompt it raises a clear error.
Outputs
MASK-[frames, H, W]full-video mask, the thing you wire into compositing or motion pipelines.anchor_mask- just the anchor frame's merged segmentation, handy for sanity checks.video_info- dict with frame count, dimensions, anchor frame, direction, object count.
Installing it
Same pack install - Manager → ComfyUI_CineStyle, or git clone into custom_nodes and restart. Then load SeC-4B once (see the loader article for the 7.35 GB download) - that's the whole setup. The requirements.txt installs the transformer stack it runs on.
Where people get burned
- It's a VRAM hog. 4B params plus video memory. When it OOMs, flip on
offload_video_to_cpuand keepauto_unload_modelon; and remember a pre-generated input needs one run to build the Selector cache before you can edit prompts. - Anchor frame jumps wipe your prompts. Switching anchor frames clears existing prompt data - the UI warns you, but it's a classic "where did my masks go" moment.
- Don't feed it semantics. Text prompts raise an error. Mask/BBox/Point only.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| model | SEC_MODEL | Loaded SeC-4B model. | |
| anchor_frame | INT | 00–10000000 | — |
| tracking_direction | COMBO | bidirectional | 3 options: forward, backward, bidirectional |
| max_frames_to_track | INT | -1-1–10000000 | — |
| mllm_memory_size | INT | 121–20 | — |
| offload_video_to_cpu | BOOLEAN | false | — |
| auto_unload_model | BOOLEAN | true | — |
| wait_for_input_cache | BOOLEAN | false | Interrupt execution when this node is reached after caching its input. |
| imagesopt | IMAGE | Video frames as an IMAGE batch. | |
| video_inputopt | VIDEO | Optional VIDEO input. | |
| prompt_dataopt | STRING | {"version":2,"objects":[]} | Selector multi-object mask, bbox, and point prompts. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |
| anchor_mask | MASK | — |
| video_info | DICT | — |