ComfyUI Node

XAudioSave

Loudness-normalized audio out of ComfyUI, no mastering suite required

By Xz3r0-M·Created 8 months ago·Updated about 6 hours ago· 13
XAudioSave
  • audio
  • processed_audio
  • save_path
filename_prefixComfyUI_%Y%-%m%-%d%_%H%-%M%-%S%
subfolderAudio
formatFLAC
sample_rate48000
target_lufs-14.1
enable_peak_limitertrue
peak_limit-1.1
enable_compressionfalse
compression_modeBalanced
use_custom_ratiofalse
custom_ratio2.0

Most audio-save nodes in ComfyUI just dump a WAV file and call it a day. That's fine until you feed that file to a platform that cares about loudness - YouTube, a podcast host, a broadcast chain - and your track comes out whisper-quiet or clipping. XAudioSave is the save node that acts like a mini mastering chain: it can resample, compress, normalize to a target LUFS, and peak-limit, then write WAV or FLAC. If your pipeline produces audio (TTS, music gen, voice cloning), this is the node that makes the output actually usable instead of "technically a file."

How it works

Under the hood it's an ffmpeg-python pipeline, which is why the pack's README hammers on FFmpeg: no FFmpeg on your system PATH, no XAudioSave. The processing order is deliberate:

  1. Resample to your chosen sample_rate (default 48000 Hz).
  2. Compress if enabled - a dynamic range compressor whose threshold is auto-calculated from the measured input loudness and your target. The presets pick the ratio: Fast (3:1, voice/podcasts), Balanced (2:1, general), Slow (1.5:1, mastering/broadcast). use_custom_ratio overrides the preset with a manual custom_ratio from 1.0 to 20.0.
  3. Normalize to your target_lufs using FFmpeg's loudnorm in a two-pass mode (it first measures, then applies) so the result lands close to the target rather than guessing.
  4. True Peak limit if enabled - broadcast-style limiting with 8x oversampling, default ceiling -1.1 dB, which keeps the file from clipping on playback.

The output processed_audio is 32-bit float. Set target_lufs to -70 to skip normalization entirely, and set enable_peak_limiter/enable_compression off to skip those stages.

Inputs that matter

  • audio - the input audio tensor.
  • target_lufs (default -14.1) - the loudness you're aiming for. Lower = quieter. -14 is a good streaming default; -70 disables.
  • format - WAV or FLAC. WAV keeps the float32 master but the author notes it doesn't reliably preserve custom workflow metadata; FLAC is lossless and embeds workflow metadata. FLAC is the better default.
  • filename_prefix / subfolder - support the pack's datetime placeholders: %Y% %m% %d% %H% %M% %S%. No path separators allowed in subfolder names.
  • enable_peak_limiter (default on) with peak_limit (-1.1 dB) - leave on unless you're doing your own limiting.

Outputs: processed_audio (the treated audio) and save_path (relative to ComfyUI's output folder).

Installing it

This is in ComfyUI-Xz3r0-Nodes, so install the pack once - ComfyUI Manager (search ComfyUI-Xz3r0-Nodes) or:

cd ComfyUI/custom_nodes
git clone https://github.com/Xz3r0-M/ComfyUI-Xz3r0-Nodes.git
cd ComfyUI-Xz3r0-Nodes
pip install -r requirements.txt

Then restart ComfyUI. The Python side pulls in ffmpeg-python from requirements.txt, but the README's warning is the one that bites people: system FFmpeg must be installed and on your PATH. On Windows that means installing FFmpeg and adding it to your environment variables, not just having it somewhere on disk.

Common issues

The classic failure is the node throwing because FFmpeg isn't found - that's the PATH problem above, and it affects XAudioSave, XVideoSave, and XDataHub's video previews. Second gotcha: compression with a wrong ratio can make speech pump or sound overprocessed, so start with enable_compression off, normalize first, and only add compression if the dynamic range is actually a problem. And if your WAV comes back without workflow metadata, that's the known WAV limitation, not a bug - switch to FLAC. One more: LUFS normalization is a loudness move, not a quality move; it won't fix a bad mix, it just makes it consistently loud.

Category♾️ Xz3r0/File-Processing

Inputs (12)

NameTypeDefaultDescription
audioAUDIOInput audio tensor
filename_prefixSTRINGComfyUI_%Y%-%m%-%d%_%H%-%M%-%S%Filename prefix, supports datetime placeholders: %Y%, %m%, %d%, %H%, %M%, %S%
subfolderSTRINGAudioSubfolder name (no path separators allowed), supports datetime placeholders: %Y%, %m%, %d%, %H%, %M%, %S%
formatCOMBOFLACOutput file format. WAV keeps float32 master output but does not reliably preserve custom workflow metadata. FLAC uses lossless compression and supports metadata embedding.
sample_rateCOMBO48000Target sample rate for the output audio file
target_lufsFLOAT-14.1-70–0Target LUFS value for loudness normalization. Lower values make audio quieter. Default -14.1, Set to -70 to disable.
enable_peak_limiterBOOLEANtrueEnable True Peak limiting (Broadcast standard, 8x oversampling). When disabled, skips peak limiting.
peak_limitFLOAT-1.1-6–0Peak limiting value in dB. Only used when enable_peak_limiter is enabled. Default -1.1, Values below 0 dB prevent clipping.
enable_compressionBOOLEANfalseEnable dynamic range compression using acompressor filter. When disabled, skips compression and proceeds directly to LUFS normalization.
compression_modeCOMBOBalancedCompression preset mode. Threshold is automatically calculated based on audio LUFS and target LUFS. Fast: Fast response for voice/podcasts, ratio=3:1. Balanced: Balanced for general use, ratio=2:1. Slow: Smooth for mastering/broadcast, ratio=1.5:1.
use_custom_ratioBOOLEANfalseEnable custom compression ratio to override preset value. When disabled, uses the preset's default ratio.
custom_ratioFLOAT2.01–20Custom compression ratio (1.0 to 20.0). Only used when use_custom_ratio is enabled. Lower values = lighter compression, higher values = stronger compression. Set ratio to 1.0 to disable compression (pass-through mode).

Outputs (2)

NameTypeDescription
processed_audioAUDIOAudio after resampling, loudness normalization, and peak limiting (32-bit float format)
save_pathSTRINGSaved file path relative to ComfyUI output directory