Nodes/Audio General/Audio Speed
ComfyUI Node

Audio Speed

Audio Speed, where 1.5 means slower — and your pitch stays put

By niknah·Created about a year ago·Updated 18 days ago· 5
Audio Speed
  • audio
  • audio
speed1.50
speed_typetorch-time-stretch

First, the trap, because it will bite you: Audio Speed's speed input is a duration multiplier, not a speed multiplier. The tooltip spells it out - ">1.0 slower. <1.0 faster" - and the default is 1.5, meaning the clip comes out half again as long, i.e. dragged out. If you wire this up, set 1.5, and wonder why your snappy TTS clip suddenly sounds like a courtroom monologue, now you know. From niknah's audio-general-ComfyUI pack, this node time-stretches audio while keeping the pitch intact - slow things down for dramatic emphasis, or speed up a droning voiceover to fit your video's runtime, without turning anyone into a chipmunk.

How it works

It's time-stretch, not varispeed. Speeding up or slowing down a recording changes its duration, and if you did that by resampling, pitch would change with it (that's exactly what the pack's Audio Pitch (Sample Rate) node does). Time-stretch keeps pitch locked by resynthesizing the signal - you get the length you want, and everyone still sounds like themselves. The speed value is a ratio: 2.0 doubles the length (half speed), 0.5 halves it (double speed). 1.0 is a no-op.

You get a choice of engine via speed_type:

  • torch-time-stretch (default) - built on torchaudio.transforms.TimeStretch via the torch-time-stretch library. It's the safe, predictable choice; leave it here unless you have a reason.
  • TDHS - time-domain harmonic scaling via the audiostretchy library. A different artifact profile that some people prefer for music, but it's the fiddlier engine. The source even carries a comment about audiostretchy segfaulting on Windows at certain ratios (it works around a crash at exactly 0.5), so if you're on Windows and get a hard crash, that's your culprit - switch back to torch-time-stretch.

Install

Standard for the pack: ComfyUI Manager → search "Audio General" → install, or

cd ComfyUI/custom_nodes
git clone https://github.com/niknah/audio-general-ComfyUI

then restart ComfyUI. The pack's requirements bring in torchaudio, librosa, torch-time-stretch, and audiostretchy; the TDHS path also pulls torchcodec under the hood. No models to download, runs on CPU.

Where people get burned

The speed-direction confusion is number one - remember it's a duration ratio, so the very first thing you'll do after installing is set speed to 1.5 expecting fast and getting slow. Second, don't push extreme ratios; stretch beyond ~2x and even pitch-preserving time-stretch gets that hollow, watery texture. Third, if the default engine ever sounds off on your material, try TDHS before giving up - but expect a rougher ride on Windows. For the common cases - fitting a voiceover to a video, slowing a clip for drama - the default torch-time-stretch at ratios between 0.5 and 2.0 just works.

CategoryAudio

Inputs (3)

NameTypeDefaultDescription
audioAUDIO
speedFLOAT1.50Speed. >1.0 slower. <1.0 faster
speed_typeoptCOMBOtorch-time-stretchTDHS - Time-domain harmonic scaling. torch-time-stretch - torchaudio.transforms.TimeStretch.

Outputs (1)

NameTypeDescription
audioAUDIO