Nodes/Audio Batch/Audio Normalize (Peak)
ComfyUI Node

Audio Normalize (Peak)

Audio Normalize (Peak) — loudest-possible without the clipping

By set-soft·Created about a year ago·Updated about a year ago· 8
Audio Normalize (Peak)
  • audio
  • normalized_audio
  • original_peak_level
peak_level1.00

Volume is a mess in raw audio. Two clips can both sound "fine" and sit at wildly different loudness, and anything you generate locally lands wherever the model felt like landing it. Audio Normalize (Peak) (SET_AudioNormalize) fixes the classic version of this: it scales a clip so its single loudest sample hits a level you choose. Generate two clips, normalize both to the same peak, and they'll at least be in the same loudness ballpark when you play them back to back.

How it works

The math is refreshingly simple - which is exactly why it's trustworthy. The node finds the peak (maximum absolute value) of each item in the batch, then computes a gain factor of peak_level / original_peak, and multiplies the whole waveform by it. Your target divided by what you've got: a clip with a peak of 0.5 normalized to 1.0 gets doubled; a clip already at 1.0 gets left alone. Silent clips are detected and left as silence rather than being amplified to infinity. That's it. No loudness averaging, no perceptual models - that's the "Peak" in the name.

The input you set is peak_level, a float from 0 to 10 where 1.0 means 0 dBFS, full scale - the loudest a sample can be before it clips. In practice you rarely want exactly 1.0; normalizing to 0.9 or so leaves headroom so downstream summing (say, a Blend) doesn't instantly distort.

The output that makes it reversible

Two outputs: normalized_audio, and original_peak_level - a tensor holding each batch item's peak before normalization. That second output is the clever bit, because it makes the whole operation undoable. Feed it into Audio Apply Batched Gain (the pack's per-item gain node) with the normalized audio, and you scale everything back to its original volume. The pack's normalize_and_undo.json example demonstrates the round-trip explicitly.

Why would you undo it? Normalize to even out a mix, then revert individual clips that you liked the way they were - or normalize for analysis, then hand back the untouched audio. It's rare that a node hands you the "before" number so you can reverse it, so use it.

Install & gotchas

From ComfyUI Manager, search "Audio Batch", or:

cd ComfyUI/custom_nodes/
git clone https://github.com/set-soft/ComfyUI-AudioBatch
pip install seconohe

Restart ComfyUI. No models to download.

One honest caveat: peak normalization isn't loudness normalization. Two clips with the same peak can still sound different in level, because a clip can peak high for a single sample and sit quiet the rest of the time. If you're mastering, you'd want RMS or LUFS-based normalization; if you're just trying to stop things from clipping and standardize your outputs, this is the right tool. And remember it can't fix a clip that's already clipped - samples lost to distortion at the source don't come back, it just rescales what's left.

Categoryaudio/manipulation

Inputs (2)

NameTypeDefaultDescription
audioAUDIOThe audio to normalize.
peak_levelFLOAT1.000–10The target peak amplitude level. 1.0 is 0 dBFS (maximum).

Outputs (2)

NameTypeDescription
normalized_audioAUDIO
original_peak_levelTORCH_TENSOR