Phase Vocoder Time Stretch (S42)
Changing length without the chipmunk effect
- audio
- AUDIO
The classic audio problem in video editing: your music bed is 28 seconds, your video is 24, and if you just resample the audio it goes squeaky-fast. S42_PhaseVocoderTimeStretch is the fix - it changes the duration of audio without changing its pitch, which is exactly what you want when matching a soundtrack to footage. It's the audio sibling of the pack's video speed-ramp nodes, and it's refreshingly honest about what it does: one input, one knob, one output.
The implementation is a real phase vocoder, via torchaudio.functional.phase_vocoder - the standard, decades-old technique for pitch-preserving time stretch. If you've ever used an old-school DJ tool's "key lock," this is that, in node form.
How it works
It takes the audio's STFT, then uses a phase vocoder to change how fast the analysis frames advance relative to synthesis - effectively stretching the spectral timeline while keeping the per-bin frequencies locked. The magnitude content stays where it is; only the time axis moves. At a stretch_factor of exactly 1.0 it short-circuits and passes the audio through untouched (no pointless processing). Below 1.0 makes it shorter/faster (0.5 = twice as fast), above 1.0 makes it longer/slower (2.0 = half speed), per the tooltip.
Inputs
audio- the track to re-time.stretch_factor- 0.1 to 10, default 1.0. Remember the inverse logic: 0.5 means half the duration (twice as fast), 2.0 means double the duration (half speed). People flip this constantly on first use.
Output
A single AUDIO with a new length, same pitch. Wire it into your audio saver, a mix, or LTX 2.3's audio conditioning.
Installing it
Standard S42 CutFlow install: ComfyUI Manager → search "S42 CutFlow", or git clone https://github.com/GeekyGhost/S42-CutFlow into ComfyUI/custom_nodes/, install requirements, restart. The phase vocoder comes from torchaudio, which ships with the portable ComfyUI build.
Gotchas
Phase vocoders have a signature weakness: transients. Snare hits and consonants smear - a 2x-stretched drum beat can sound like a wash, and a stretched voice can develop a subtle watery "phasy" sheen. For music beds it's usually fine; for drums and dialogue, stretch conservatively (1.2–1.5×) and listen. Extreme factors (5×+) will get wobbly no matter what - that's physics, not a bug. And there's no sample-rate juggling here; the output keeps the input's sample rate, so it's clean to slot into an existing pipeline. Pair it with the pack's AudioVideoSync node if you also need the audio re-fit to a video's exact frame count.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | Audio to re-time. | |
| stretch_factor | FLOAT | 1.000.1–10 | 0.5 = Twice as fast. 2.0 = Half speed. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| AUDIO | AUDIO | — |