Nodes/MKRShift_Nodes/Beat Sync Retimer
ComfyUI Node

Beat Sync Retimer

Make your video land on the beat — or just get the math

By criskb·Created 7 months ago·Updated 5 months ago· 0
Beat Sync Retimer
  • video
  • video
  • speed_factor
  • beat_interval_sec
  • beat_markers_json
  • summary
target_bpm120.0
beats_per_segment4
source_bpm120.0
modeplan_only
output_formatauto
filename_prefixMKR_beat_sync
subfolder
overwritefalse
filename_label

The name is a lie in the best way: MKRBeatSyncRetimer doesn't detect a beat, it does the arithmetic that lets you sync to one, and it can retime the clip to match. If you're cutting AI-generated clips to music, this is the node that tells you "your 4-beat segment at 90 BPM needs to run at 1.33x to hit 120" - and then optionally does the speed change with ffmpeg.

It's part of MKRShift_Nodes, the big kitchen-sink pack by criskb. No pip packages, no model downloads. ComfyUI Manager → search "MKRShift_Nodes", or clone it into custom_nodes/, restart, and the node shows up under MKRShift Nodes → Media → Timeline.

How it works

The math is dead simple, which is why it's trustworthy. It computes a speed factor as target_bpm / source_bpm. Then it figures out your beat grid: beat_interval_sec = (60 / target_bpm) * beats_per_segment, and generates a marker at every interval from frame zero to the end of the clip.

What you do with that depends on mode:

  • plan_only (default) - nothing touches your files. You get the speed factor, the beat interval, and a JSON list of beat marker timestamps to wire into whatever else you're building. This is the mode to start in.
  • retime_with_ffmpeg - actually renders a new file. Video gets setpts=PTS/speed; if the source has audio, it gets an atempo chain so the pitch doesn't turn into chipmunk.

The inputs that matter

Only three of these will bite you:

  • target_bpm and source_bpm - the whole node is their ratio. If you don't know the source BPM, set it to 0: the node assumes you're already at target and returns a speed factor of 1.0.
  • beats_per_segment - how many beats each cut spans. 4 is the standard "one bar" feel.
  • mode - plan_only vs. actually rendering.

Outputs: video (an MKR_VIDEO payload), speed_factor, beat_interval_sec, beat_markers_json, and a summary with the duration and any warnings.

Where people get burned

The retime path needs a file-based video input, not frames. If your upstream node hands it a frame sequence, plan_only still works fine (markers are computed from duration), but retime just warns and passes the source through. And retime_with_ffmpeg requires ffmpeg on your system - the README calls that out explicitly for the video/audio nodes, and on Windows that means adding it to PATH. No ffmpeg, no render; the summary string will tell you exactly what it skipped.

CategoryMKRShift Nodes/Media/Timeline

Inputs (10)

NameTypeDefaultDescription
video*
target_bpmFLOAT120.01–400
beats_per_segmentINT41–32
source_bpmFLOAT120.00–400
modeCOMBOplan_only2 options: plan_only, retime_with_ffmpeg
output_formatCOMBOauto4 options: auto, mp4, mov, webm
filename_prefixSTRINGMKR_beat_sync
subfolderSTRING
overwriteBOOLEANfalse
filename_labeloptSTRING

Outputs (5)

NameTypeDescription
videoMKR_VIDEO
speed_factorFLOAT
beat_interval_secFLOAT
beat_markers_jsonSTRING
summarySTRING