Audio Pitch
Pitch-shift a voice without making it run faster (Audio Pitch)
- audio
- audio
You've got a voiceover that's a little too low, or a TTS clip you want to brighten up, and the one thing you can't afford is the length changing. That's the whole point of Audio Pitch: it shifts the pitch of an AUDIO clip and leaves the duration and sample rate alone. It's the "proper" pitch shifter in Audio General (niknah's audio-general-ComfyUI pack), and it sits in the graph right after LoadAudio - feed it any AUDIO, get an AUDIO back, then wire it into PreviewAudio, SaveAudio, or straight into your video's audio mux.
How it works
Behind the scenes this node is a thin wrapper around torchaudio.transforms.PitchShift, which is a phase-vocoder. The waveform gets chopped into overlapping STFT frames, the frequency bins are shifted up or down, and the frames are stitched back so the playback speed is unchanged. That's the trick: pitch is a frequency thing, duration is a time thing, and the phase vocoder lets you move one without wrecking the other. The downside of every phase-vocoder is a little smearing - push the shift far enough and you get that warbly, phasey artifact. Keep it to a few semitones and it's hard to hear.
The inputs that matter
Only one input is worth your attention most of the time: n_steps, default 2. It's the number of steps (fractional allowed) to shift the pitch, where bins_per_octave (default 12) defines what a "step" is - so by default one step is a semitone and 12 is a full octave. Positive raises pitch, negative lowers it. Want a voice up a fourth? That's n_steps = 5. Down an octave for a menacing trailer voice? n_steps = -12.
The rest you can honestly ignore until something sounds wrong. n_fft (512) is the FFT window size - bigger windows resolve low frequencies better but blur fast transients. win_length and hop_length default to -1, which means "let torchaudio pick based on n_fft", and that's the right call for 99% of use. If a shift sounds mushy, nudging n_fft up is the first thing to try, not the last.
Install
Install the pack once and you get all nine Audio General nodes, including this one. Via ComfyUI Manager, search "Audio General" and hit install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/niknah/audio-general-ComfyUI
Then restart ComfyUI. The pack pulls in torchaudio (usually already in your environment), librosa, torch-time-stretch, and audiostretchy - no model downloads, no checkpoints, nothing to put in a models folder. It runs on CPU fine; pitch shifting a voiceover is not a GPU job.
Where people get burned
The easy mistake is reaching for this when you actually wanted a varispeed effect - Audio General's other pitch node, Audio Pitch (Sample Rate), changes pitch and length with zero DSP. If you need length preserved, that's this node. And if the result sounds watery at big shifts, don't crank n_steps and blame the node - break the change into steps or accept that ±12 semitones is where phase vocoders start showing their seams.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | — | |
| n_steps | INT | 2 | The (fractional) steps to shift waveform. |
| bins_per_octaveopt | INT | 12 | The number of steps per octave (Default : 12). |
| n_fftopt | INT | 512 | Size of FFT, creates n_fft // 2 + 1 bins (Default: 512). |
| win_lengthopt | INT | -1 | Window size. If -1, then n_fft is used |
| hop_lengthopt | INT | -1 | Length of hop between STFT windows. If None, then win_length // 4 is used |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |