ComfyUI Node

AudioSpeedShift

Time-stretch or compress audio by a rate

By christian-byrne·Created 2 years ago·Updated 4 months ago· 593
AudioSpeedShift
  • audio
  • AUDIO
rate1.0

AudioSpeedShift changes how fast a clip plays back - speed it up, slow it down, or nudge it slightly, all controlled by a single rate value. A rate of 2.0 plays it back twice as fast; 0.5 plays it back at half speed. It's a small, single-purpose node from the audio-separation-nodes-comfyui pack, and the kind of thing you don't need until the exact moment you do.

Why you'd reach for it

The main use is syncing audio to something else that's already fixed in length - you've trimmed a video, and now your audio track needs to shrink or stretch to match; or you've got two clips you want to line up and one just runs a little long. It also pairs naturally with the pack's tempo tools: use AudioGetTempo to read a track's BPM, work out the ratio you need, and feed that ratio straight into this node's rate input.

Worth knowing the difference between this and AudioTempoMatch, which lives in the same pack: TempoMatch automatically works out and applies a tempo-matching rate for you between two tracks. AudioSpeedShift is the manual version - you supply the rate yourself, which means it also works for anything that isn't about matching two songs, like just wanting a clip 20% faster.

How it works

The node description calls this "time-stretch or time-compress," and the pack lists librosa as a core dependency - librosa's time-stretching is phase-vocoder based, which is the standard technique for changing duration without dragging pitch along with it (unlike just speeding up playback, which pitches everything up like a chipmunk). The info schema doesn't spell out the exact algorithm, but given librosa is doing the heavy lifting elsewhere in this pack, that's the reasonable bet - worth a quick listen on your own clip if pitch preservation matters for your use case.

The inputs and outputs that matter

Two required inputs, and that's it:

  • audio - the AUDIO clip to stretch or compress.
  • rate - a float, default 1 (no change), with a range of 0.1 to 10 in steps of 0.1.

1.0 is unchanged, values above 1.0 speed the clip up, values below 1.0 slow it down. The allowed range is wide - 0.1 gets you a tenth of the original speed, 10 gets you ten times as fast - but the further you push toward either extreme, the more likely you are to hear artifacts (smearing at very slow rates, a stuttery quality at very fast ones). Small adjustments, in the 0.8–1.3 range, tend to sound the cleanest.

Output is a single AUDIO - the time-shifted clip.

Installing it

Search audio-separation-nodes-comfyui in ComfyUI Manager, or manually: cd ComfyUI/custom_nodes && git clone https://github.com/christian-byrne/audio-separation-nodes-comfyui, cd in, pip install -r requirements.txt, restart ComfyUI. This node's dependency is librosa; no model download, no GPU work - it runs fast regardless of clip length.

Common issues

No model checkpoint here, so the Demucs-related troubleshooting documented for AudioSeparation (the BadZipFile corrupted-download error) doesn't apply. If your output sounds warbly or unnatural, it's almost always a rate that's too extreme for the material - dialogue and vocals tend to break down faster than instrumental or ambient audio when pushed past roughly 1.5x or below roughly 0.6x. Dial it back toward 1.0 and step in smaller increments if you need a specific target duration.

Categoryaudio

Inputs (2)

NameTypeDefaultDescription
audioAUDIO
rateFLOAT1.00.1–10

Outputs (1)

NameTypeDescription
AUDIOAUDIO