Nodes/ComfyUI_Fill-Nodes/FL Scan Video Section
ComfyUI Node

FL Scan Video Section

Cut a video into N equal chunks (no, it does not detect scenes)

By filliptm·Created 3 years ago·Updated a day ago· 638
FL Scan Video Section
  • images
  • IMAGE
sections4
section_index0

The name promises more than the node does. "Scan Video Section" sounds like scene detection - it isn't. It splits a frame batch into N chunks by arithmetic and hands you chunk number i. That's the whole feature, and it's exactly why it's useful: it's the plumbing that lets you run four heavy analysis branches over one video without writing a custom sampler.

Why you'd reach for it

Any per-frame analysis chain that needs a model - depth, normals, person detection, pose - is slow, and ComfyUI runs one branch at a time. If your graph has a single 600-frame video going into Depth Anything V2, you sit and watch a progress bar. Split it into four 150-frame chunks and you can wire four independent branches, kill the whole thing when branch two is wrong, and let ComfyUI's cache hold each branch's result separately while you iterate on the effect downstream.

This is how the pack's own H3 Street Scan workflow does it: four FL_ScanVideoSection nodes at indices 0–3 with sections=4, all fed by the same video, each feeding its own analysis pass, then all four packaged with FL Scan Analysis and handed to the scan compositor. The chunks must reconstitute the whole video in order, and the proportional math guarantees that.

How the split actually works

start = len(images) * section_index // sections
end   = len(images) * (section_index + 1) // sections
return (images[start:end].clone(),)

Integer division on the frame count. Boundaries are deterministic, adjacent chunks share no frames, and indices 0 … sections-1 cover every frame exactly once - remainders included, so a 601-frame video with 4 sections gives you 150/150/150/151, not a dropped frame. It's a pure slice-and-clone: no decode, no models, no GPU, nothing to configure but two integers.

Because the boundaries are proportional rather than detected, they move when the video length changes. Cache your analysis before you start fiddling with trims, or you'll silently re-render every branch.

Inputs and output

  • images - the decoded video batch.
  • sections - how many chunks the video is cut into (1–100, default 4). This is the number of branches you intend to build.
  • section_index - which chunk this particular node emits (0–99, default 0). Nothing auto-increments it; you set it by hand on each node, so four nodes means typing 0, 1, 2, 3.

One output: IMAGE, a single batch containing just this chunk's frames. Wire it anywhere you'd wire the full video - a depth preprocessor, FL Scan Video Detections, FL Voxel Normal Relief, whatever. Downstream, if you're building the scan pipeline, each chunk's maps get packaged with FL Scan Analysis and the chunks are re-collected in order, so the total frame count and resolution of the whole set still has to match the source video.

Install

The pack is one install for everything Fill-Nodes ships - Manager, search ComfyUI_Fill-Nodes (publisher machinedelusions), or:

cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
cd ComfyUI_Fill-Nodes && pip install -r requirements.txt

Restart ComfyUI afterwards. Fair warning: that requirements.txt is enormous - google-cloud-storage, openai, anthropic, keyring, runwayml, fal-client, open_clip_torch, beat-this - and people do panic at the startup log the first time (there's a whole r/StableDiffusion thread titled "Um, should we be worried?"). It's for the pack's cloud and API nodes, not this one. Neither FL_ScanVideoSection nor its siblings in the scan pipeline needs an API key, a model download, or a network call. If you want to trim what lands in your shared Python env, the scan nodes only need OpenCV, NumPy and Torch, all of which ComfyUI already has.

Where people get bitten

  • More sections than frames. sections above the frame count raises Scan Video Section: use at least one frame per section and an index below the section count. A 3-frame test clip and sections=4 will not work. Same error if section_index is ≥ sections.
  • Building the chunks is on you. There's no "split into list" mode. N sections means N nodes, N sets of upstream preprocessing, and a manual bookkeeping problem - if you forget index 2, the pipeline is one chunk short and the alignment check downstream will fail with a confusing message.
  • It is not a shot splitter. If you want boundaries at real cuts, or want the downstream branch to run once per authored shot, use FL Scan VideoShots with a prompt schedule instead. Sections are processing blocks. Nothing more.
  • Duplicate upstream work. Four branches means four decodes unless you feed them from one loaded video node. Put the loader before the split so the decode is shared.
Category🏵️Fill Nodes/VFX

Inputs (3)

NameTypeDefaultDescription
imagesIMAGE
sectionsINT41–100
section_indexINT00–99

Outputs (1)

NameTypeDescription
IMAGEIMAGE