Nodes/ComfyUI_CineStyle/CS Video Segment (SeC-4B)
ComfyUI Node

CS Video Segment (SeC-4B)

SAM2 tracks how things look. This node tracks what they are.

By chflame163·Created 26 days ago·Updated 3 days ago· 72
CS Video Segment (SeC-4B)
  • model
  • images
  • video_input
  • MASK
  • anchor_mask
  • video_info
anchor_frame0
tracking_directionbidirectional
max_frames_to_track-1
mllm_memory_size12
offload_video_to_cpufalse
auto_unload_modeltrue
wait_for_input_cachefalse
prompt_data{"version":2,"objects":[]}

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 - the SEC_MODEL from 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, or backward. Bidirectional is the safe default.
  • max_frames_to_track - -1 means "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_cpu and keep auto_unload_model on; 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.
Category😺dzNodes/CineStyle/Video

Inputs (11)

NameTypeDefaultDescription
modelSEC_MODELLoaded SeC-4B model.
anchor_frameINT00–10000000
tracking_directionCOMBObidirectional3 options: forward, backward, bidirectional
max_frames_to_trackINT-1-1–10000000
mllm_memory_sizeINT121–20
offload_video_to_cpuBOOLEANfalse
auto_unload_modelBOOLEANtrue
wait_for_input_cacheBOOLEANfalseInterrupt execution when this node is reached after caching its input.
imagesoptIMAGEVideo frames as an IMAGE batch.
video_inputoptVIDEOOptional VIDEO input.
prompt_dataoptSTRING{"version":2,"objects":[]}Selector multi-object mask, bbox, and point prompts.

Outputs (3)

NameTypeDescription
MASKMASK
anchor_maskMASK
video_infoDICT