Nodes/RyanOnTheInside/Audio Time Stretch βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
ComfyUI Node

Audio Time Stretch βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜

Change how long a clip is without touching its pitch

By ryanontheinsideΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 852
Audio Time Stretch βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
  • audio
  • AUDIO
β—„rate1.00β–Ί

Time-stretching is the thing that lets you slow a track down or speed it up without the pitch shifting along with it - different from just changing the sample rate (which drags pitch and duration together, chipmunk-or-demon style). This node does the "real" version: duration changes, pitch doesn't.

Inputs and outputs

  • audio - the clip to stretch.
  • rate - the stretch factor, 0.5 to 2.0, default 1.0. Below 1.0 slows the clip down (longer duration, same pitch); above 1.0 speeds it up (shorter duration, same pitch).

Output is a single AUDIO.

Why you'd reach for this specifically

The obvious use case in this pack's context: you've got a music clip that's slightly the wrong length for your target video duration, and you want it to line up with a frame count you've already committed to (from AudioInfo, say) without shifting the key. Stretch it to fit instead of trimming a chunk off the end or padding silence in - the whole track stays intact, just compressed or expanded in time.

If you actually want a pitch change too - different feel, not just a length fix - that's a separate node (AudioPitchShift). This one deliberately holds pitch fixed while duration moves.

Worth noting the math isn't linear-obvious: a rate of 1.5 doesn't mean "1.5 seconds longer," it means the whole clip's duration divides by 1.5 (rate above 1.0 speeds up, so duration shrinks). If you're solving for an exact target duration, work backward from audio_duration (from AudioInfo) and your target length - rate = original_duration / target_duration - rather than guessing and checking.

Installing it

ComfyUI Manager: search RyanOnTheInside, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside
cd ComfyUI_RyanOnTheInside
pip install -r requirements.txt

No model downloads needed.

Where people get burned

Time-stretching is not free - it's a real signal-processing trick, and pushing rate toward the extremes (near 0.5 or near 2.0) introduces audible artifacts on complex material: a warbly, phasey quality, especially on vocals and percussive transients, which degrade faster under stretching than pads and sustained tones. If you're stretching a vocal-heavy or drum-heavy track hard, expect it to sound noticeably processed, not just slower. For small corrections (a few percent to line up a frame count) you won't hear anything unusual; for dramatic length changes, budget for the artifact and consider whether trimming or padding the silence instead would actually serve the workflow better than a hard stretch. If the whole point is matching a video's length exactly, AudioPad/AudioTrim for small gaps and AudioTimeStretch for genuine tempo changes are two different tools solving two different problems - don't reach for a stretch when a trim or a bit of silence would do the job with zero artifact risk.

CategoryRyanOnTheInside/Audio/Effects

Inputs (2)

NameTypeDefaultDescription
audioAUDIOInput audio to be processed
rateFLOAT1.000.5–2Time stretching factor (0.5 to 2.0)

Outputs (1)

NameTypeDescription
AUDIOAUDIOβ€”