Nodes/S42 CutFlow/🥁 S42 CutFlow Beat Snap
ComfyUI Node

🥁 S42 CutFlow Beat Snap

Auto-detect the beats in your track and cut your footage to them

By GeekyGhost·Created 6 months ago·Updated 4 months ago· 3
🥁 S42 CutFlow Beat Snap
  • audio
  • beat_data
  • beat_count
  • info
fps24.0
sensitivity0.50
min_interval0.3
output_formatframe_indices

Beat-synced editing - cutting on every kick so the montage breathes with the music - is the defining technique of music videos and short-form content, and it's usually done by eye on a timeline. S42CF Beat Snap automates it: feed it an AUDIO track and it hands you the frame numbers where the beats land, ready to drive cuts. It's the pack's answer to "I want my video to visibly sync to the music," and it's the node that makes the whole montage workflow click.

Mechanism, so you know what "beat" means here: it mixes to mono, slides a short energy window (20ms) across the track, and looks for positive jumps in that energy - onsets, essentially. It then picks the strongest ones using sensitivity and enforces a minimum spacing with min_interval. That's onset detection, not tempo inference: it reacts to percussive hits rather than calculating BPM. For drums that's effectively the same thing; for ambient music with no transients you'll get very few beats, which is correct behavior, not a bug.

The inputs that matter:

  • fps - must match your video's frame rate. Beats are detected in time and converted to frame indices at this value, so 24 for a 24fps clip.
  • sensitivity (0.1–1, default 0.5) - lower means fewer beats (only strong hits); higher catches more. If you're getting a hit on every hat and it feels spastic, drop it to ~0.3. If you're only getting the downbeats and want more cuts, raise it.
  • min_interval (default 0.3s) - minimum gap between detected beats; stops one kick from registering twice. Raise it if beats bunch up.
  • output_format - how the beats come out:
    • frame_indices - plain comma-separated frame numbers.
    • split_points - same numbers, but flagged as ready for the pack's S42CF Multi Split node (they're interchangeable in practice; the flag is convention).
    • keyframe_string - frame:1.0 format for keyframe-based scheduling elsewhere.

Outputs are beat_data (the string above), beat_count (INT - instant feedback on whether your settings found a sensible number), and info.

The canonical wiring, straight from the README: Beat Snap → beat_data → Multi Split's split_points and your footage is cut on every beat automatically. Add S42CF Transition between segments and a montage assembles itself.

One caveat from the code worth knowing: it needs scipy's find_peaks for the quality path - scipy ships with ComfyUI, so you're fine - and if scipy is somehow missing it falls back to a manual peak scan that works but is less precise. If beats ever look slightly off, check your fps first; a mismatch there silently shifts every cut by a growing amount.

Installing it

S42-CutFlow install: ComfyUI Manager → search "S42 CutFlow" → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/GeekyGhost/S42-CutFlow.git
pip install -r S42-CutFlow/requirements.txt

One-line requirements (opencv-python-headless); numpy/scipy do the detection and both ship with ComfyUI. "[S42 CutFlow] Loaded ..." on restart = good to go.

The takeaway

It's onset detection, not BPM analysis - and for syncing cuts to drums that's exactly the tool you want. Wire it into Multi Split, tune sensitivity until the cuts match your energy, and your montage starts hitting on the beat without a single hand-placed marker.

CategoryS42 CutFlow/Audio Sync

Inputs (5)

NameTypeDefaultDescription
audioAUDIOAudio to analyze for beats.
fpsFLOAT24.01–120Video FPS to convert beat times to frame indices.
sensitivityFLOAT0.500.1–1Beat detection sensitivity. Lower = fewer beats detected (only strong beats). Higher = more beats.
min_intervalFLOAT0.30.1–5Minimum time between detected beats in seconds. Prevents double-triggers.
output_formatCOMBOframe_indices'frame_indices' = comma-separated frame numbers. 'split_points' = ready for MultiSplit node. 'keyframe_string' = frame:1.0 keyframe format.

Outputs (3)

NameTypeDescription
beat_dataSTRING
beat_countINT
infoSTRING