Nodes/ComfyUI_Fill-Nodes/FL Video Cadence
ComfyUI Node

FL Video Cadence

Detect scene cuts and get the frame count of each shot

By filliptm·Created 3 years ago·Updated about 10 hours ago· 628
FL Video Cadence
  • images
  • scene_lengths_str
fps24
threshold30.0
min_scene_length12
detection_methodhybrid
downsample_detectiontrue
use_gpu_accelerationtrue

Editors talk about a video's cadence - the rhythm of its cuts, how long each shot holds before it changes. FL_VideoCadence measures that automatically. Feed it a batch of frames and it detects where the scene changes, then outputs a comma-separated list of frame counts, one number per detected shot. So a video that cuts every couple of seconds comes back as something like 48,52,36,60,....

On its own that's a useful analysis. Paired with the pack's compile node, it becomes a way to re-time generated footage to match a reference video's editing rhythm - analyze a real clip's cadence, then chop your AI footage to the same shot lengths so it feels edited rather than one long take.

How it works

The node walks the frames looking for big frame-to-frame changes - a cut is a sudden jump in the image. It offers three detection methods: intensity (raw brightness/pixel change), histogram (color distribution shift, more robust to motion), and hybrid (both, the default). A threshold decides how big a change counts as a cut, and a min_scene_length stops it from calling every flicker a new scene. It can downsample and use the GPU to keep the analysis fast on long batches.

The inputs and outputs that matter

Required, with the ones you'll actually tune first:

  • images (IMAGE) - the frame batch to analyze.
  • threshold (FLOAT, default 30) - cut sensitivity. Lower finds more cuts (more sensitive), higher only flags dramatic changes. This is the main knob.
  • min_scene_length (INT, default 12) - the shortest a shot can be, in frames. Raises the floor so brief flashes don't fragment into micro-scenes.
  • detection_method (intensity / histogram / hybrid) - hybrid is the sensible default; switch to histogram if camera motion is causing false cuts.
  • fps (INT, default 24) - context only. Per the node itself, FPS is there to help you reason about frame-based settings; it doesn't change detection.
  • downsample_detection and use_gpu_acceleration (BOOLEAN) - speed options, on by default.

Output is a single scene_lengths_str (STRING) - the comma-separated frame counts. Feed it into FL_VideoCadenceCompile to cut footage to those lengths.

When you'd reach for it

Matching AI-generated video to the pacing of a reference edit, splitting a long generation into shot-sized chunks, or just analyzing how a clip is cut. It's the analysis half of a two-node pattern; the compile node does the actual cutting.

Installing it

ComfyUI ManagerComfyUI_Fill-Nodes → install → restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes

then restart. The video nodes use OpenCV, installed with the pack.

Common issues & troubleshooting

Too many cuts detected. Threshold too low, or heavy motion tricking the intensity method. Raise threshold, bump min_scene_length, or switch detection_method to histogram, which cares about color distribution rather than raw pixel change.

It missed obvious cuts. Threshold too high. Lower it until the real cuts register - then nudge min_scene_length back up if that reintroduces noise.

FPS didn't change anything. Correct - fps here is just context for you when you're setting frame-based values like min_scene_length. It's not part of the detection math.

The output only makes sense with the compile node. Right - scene_lengths_str is a handoff format. To use the cadence, pair it with FL_VideoCadenceCompile, which reads those counts and cuts accordingly.

Category🏵️Fill Nodes/Video

Inputs (7)

NameTypeDefaultDescription
imagesIMAGE
fpsINT241–120
thresholdFLOAT30.01–100
min_scene_lengthINT122–1000
detection_methodCOMBOhybrid3 options: intensity, histogram, hybrid
downsample_detectionBOOLEANtrue
use_gpu_accelerationBOOLEANtrue

Outputs (1)

NameTypeDescription
scene_lengths_strSTRING