Nodes/S42 CutFlow/Dynamic Pitch Correction (S42)
ComfyUI Node

Dynamic Pitch Correction (S42)

S42's pitch 'correction' is a phase trick, not the real thing

By GeekyGhost·Created 6 months ago·Updated 4 months ago· 3
Dynamic Pitch Correction (S42)
  • audio
  • AUDIO
retune_speed_ms40
vibrato_preservation0.7
scale

Let's be direct about what this is, because the name oversells it. S42_DynamicPitchCorrection is not Celemony Auto-Tune. There's no pitch detection, no F0 tracking, no snapping to actual notes. It's a spectral phase-smoothing effect that sounds like a light tune-up on the right material, and a weird robot-warble on the wrong material. If you want that, great - it's a free, deterministic effect that runs on CPU. If you were expecting to fix a genuinely off-key vocal, temper that expectation.

How it works

The node takes your audio, runs a 2048-sample STFT, and then does something almost insultingly simple to the phase: it blends each frame's raw phase with the phase rounded to the nearest integer, controlled by vibrato_preservation.

  • vibrato_preservation at 1.0 → phase untouched, output ≈ input.
  • At 0.7 (default) → a light correction flavor.
  • Near 0 → phase fully snapped, which is where the "corrected" and slightly robotic character lives.

Because the magnitude spectrum is left alone and only phase is nudged, the result keeps the timbre but flattens some of the pitch wander - the "correction" feel. It's a legitimate DSP trick, just not note-accurate tuning.

The inputs

  • audio - your AUDIO (mono or stereo; it reshapes and processes all channels).
  • retune_speed_ms - 40 default, 0–200. Lower is snappier/more aggressive, higher is more relaxed and less artifacty.
  • vibrato_preservation - the main knob, 0–1. The higher you go, the more natural vibrato survives (and the less "correction" you hear).
  • scale - Chromatic / Major / Minor / Pentatonic. Here's the honest bit: in the current source, this selector is declared but never actually used in the math. The phase gets snapped to integer bins regardless of which scale you pick. So pick one and don't expect it to change anything yet - it's clearly a placeholder for a fuller implementation.

Output

One AUDIO out, which flows to your audio saver, a mix, or LTX 2.3's audio conditioning. No info string on this one - it's a lean node.

Installing it

Part of S42 CutFlow: ComfyUI Manager (search "S42 CutFlow") or git clone https://github.com/GeekyGhost/S42-CutFlow into ComfyUI/custom_nodes/, then install requirements and restart. The advanced audio nodes lean on torchaudio, which ships with the ComfyUI portable build; if you're on a stripped-down install you'll need pip install torchaudio matching your torch version.

Gotchas

Expect artifacts on strong transients and sibilants - phase snapping is friendly to sustained tones, not to consonants. And because there's no real note detection, don't crank retune_speed_ms to 200 on a lead vocal and hope for pitch-perfect; you'll get a warbly, artificial sheen instead. Use it as a subtle glue on narration or as a deliberate vocal effect, not as a fixer.

CategoryS42 CutFlow/Audio/Enhancement

Inputs (4)

NameTypeDefaultDescription
audioAUDIO
retune_speed_msINT400–200
vibrato_preservationFLOAT0.70–1
scaleCOMBO4 options: Chromatic, Major, Minor, Pentatonic

Outputs (1)

NameTypeDescription
AUDIOAUDIO