Draw Rhythm Tracks
A beat-locked point that turns rhythm into motion control
- IMAGE
Draw Rhythm Tracks is the reason this pack exists. It renders a sequence of images of a single colored point swinging in time with a BPM - a fading trail of dots tracing a path - and those frames are exactly the kind of thing video models take as motion control. The README says it plainly: the output is for LTXVideo and other motion-control workflows, and the source even swaps the frames to BGR "to match IC-LoRA training data format." If you've seen the LTX ecosystem's in-context LoRAs condition generation on a control video, this is you building that control video from a rhythm instead of drawing it by hand.
Why would you want a floating dot as a control signal? Because a prompt cannot express "swing on the downbeat, hold still for the rest of the bar" - a point that traces that path absolutely can. It's the cheapest, most readable way to hand a motion-conditioned model an exact trajectory that's also locked to your music.
How it works
The mechanism is neat and worth understanding, because the knobs stop being mysterious once you do. Each frame gets a time value, the phase is computed as (frame_time / beat_period) × rhythm × 2π, and that phase drives one of three swing patterns:
- pendulum - a sine wave: smooth easing through the swing, slower at the extremes.
- bounce - a parabolic arch with a phase shift so the point starts at rest and hops.
- linear - a triangle wave: constant-speed back-and-forth, the "mechanical" feel.
Position is start_x/start_y plus the pattern's offset, scaled by rate_x/rate_y as a fraction of the image size. The point has a trail up to 50 frames, color-coded by age (old dots fade toward blue, fresh ones burn red), and its radius scales with the output resolution. All rendered as filled circles per frame - pure PyTorch, no external imaging library.
The inputs that actually matter
There are fourteen of them, but you'll touch these:
- bpm - the tempo. One beat is one swing cycle, unless you multiply it (below).
- fps and length - frame rate and duration. These set your frame count.
- width / height / start_x / start_y - the canvas and where the swing centers.
- rate_x / rate_y - how far the point travels, as a ratio of the image dimension. 0.5 means it sweeps across half the width.
- rhythm_x / rhythm_y - the sneaky-good ones. Effective BPM is
bpm × rhythm_x, so with a 140 track you can make the X axis swing at quarter-note speed (rhythm_x 0.25) while Y does a slow whole-bar bob (rhythm_y 1.0). Independent X/Y timing is what separates "motion" from "metronome."
The single output is IMAGE - a batch of frames, one per rendered frame. Wire it into VHS_VideoCombine (the bundled example workflows do exactly this) to get an mp4, or feed the frames into your LTX control-video slot.
Where it bites
- The render loop is pure Python per frame, so long lengths at high fps on big canvases get slow. 512×512 at 24fps for 5 seconds is instant; pushing 8192-wide frames at 120fps will make you wait.
- The trail is a fixed 50 frames. At 24fps that's a ~2 second tail; at 60fps it collapses to under a second. If your trail suddenly looks short, check your fps first.
- The colors are BGR on purpose. The frame swap matches how the author's IC-LoRA data was trained. If a preview looks slightly color-wonky in an RGB viewer, that's not a bug - it's the contract with the model.
Install
ComfyUI Manager - search "ComfyUI-Rhythm-Tracks" - or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/grmchn/ComfyUI-Rhythm-Tracks
cd ComfyUI-Rhythm-Tracks
pip install -r requirements.txt
That's librosa and torchaudio on top of ComfyUI's own torch/numpy. No models to download. One gotcha: the pack is built against ComfyUI's newer Node SDK (comfy_api.latest), so a stale ComfyUI install will refuse to load it - update ComfyUI first if the node doesn't appear. It's a small hobbyist pack (grmchn, GPL-3.0, Japanese README), but it's self-contained enough that the source in nodes.py is the best debugging doc you have.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| bpm | FLOAT | 140.030–300 | Tempo in beats per minute. One beat = one swing cycle. |
| fps | FLOAT | 24.01–120 | Output frame rate. |
| length | FLOAT | 5.00.1–60 | Output duration in seconds. |
| width | INT | 5128–8192 | Output image width in pixels. |
| height | INT | 5128–8192 | Output image height in pixels. |
| start_x | INT | 2560–8192 | Swing center point X coordinate. |
| start_y | INT | 1280–8192 | Swing center point Y coordinate. |
| pattern_x | COMBO | pendulum | X-axis swing pattern. |
| pattern_y | COMBO | bounce | Y-axis swing pattern. |
| rate_x | FLOAT | 0.500–1 | Horizontal swing width as ratio of image width. |
| rate_y | FLOAT | 0.250–1 | Vertical swing width as ratio of image height. |
| rhythm_x | FLOAT | 0.250.01–10 | X-axis BPM multiplier. Effective BPM = bpm * rhythm_x. |
| rhythm_y | FLOAT | 1.000.01–10 | Y-axis BPM multiplier. Effective BPM = bpm * rhythm_y. |
| delay | FLOAT | 0.00-10–10 | Time offset in seconds. Negative = earlier, positive = later. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |