Beat Sync Retimer
Make your video land on the beat — or just get the math
- video
- video
- speed_factor
- beat_interval_sec
- beat_markers_json
- summary
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 anatempochain so the pitch doesn't turn into chipmunk.
The inputs that matter
Only three of these will bite you:
target_bpmandsource_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.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| video | * | — | |
| target_bpm | FLOAT | 120.01–400 | — |
| beats_per_segment | INT | 41–32 | — |
| source_bpm | FLOAT | 120.00–400 | — |
| mode | COMBO | plan_only | 2 options: plan_only, retime_with_ffmpeg |
| output_format | COMBO | auto | 4 options: auto, mp4, mov, webm |
| filename_prefix | STRING | MKR_beat_sync | — |
| subfolder | STRING | — | |
| overwrite | BOOLEAN | false | — |
| filename_labelopt | STRING | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| video | MKR_VIDEO | — |
| speed_factor | FLOAT | — |
| beat_interval_sec | FLOAT | — |
| beat_markers_json | STRING | — |
| summary | STRING | — |