MD: Audio Guardian
The node that keeps a NaN from blowing out your speakers
- audio
- audio
Here's a fun one: audio generation can silently produce NaN or Inf values - the tensor equivalent of a math error - and when those hit a playback node or a muxer, you get a deafening crack or a full speaker pop. MD_Audio_Guardian is a tripwire that scans your audio before it goes anywhere dangerous and decides what to do about it.
It's part of the pack's Guardian Suite, the same family as the NaN and Image guardians. The mechanism is honest and cheap: it scans the waveform tensor for three conditions - NaN values, Inf values, and clipping (samples beyond ±1.0) - then acts according to your action setting.
The inputs
audio- the AUDIO dictionary to protect. The tooltip's placement advice is the right one: connect it before saving or playback nodes, because by the time the bad audio hits the muxer it's too late.action- what to do when corruption is found:- Hard Clip to [-1.0, 1.0] (Rescue) - the default, and the one the author recommends. NaNs become 0, ±Inf clamp to ±1, and everything clamps into safe range. You keep your render, slightly roughed up.
- Mute Output (Rescue) - replaces the corrupted audio with silence. Safer ears, but you lose the take.
- Raise Hard Error - throws an exception and halts the workflow so you can fix the source.
- Graceful Interrupt - interrupts current processing and stops the queue.
debug_mode/enable_profiling- console verbosity and per-scan timing.
One output: audio, clean or rescued. If nothing was wrong, it passes through untouched.
When you'll actually use it
For ACE-Step audio workflows specifically, it's a smart habit: generative audio lands with wild peaks more often than you'd like, and a single bad render played back at full volume is a genuinely bad experience. Put it in front of your save/export node and the worst case becomes "clipped audio I can re-run," not "my ears rang for an hour." It's also quietly useful as a diagnostic - set it to Raise Hard Error while you're developing, and a silent workflow failure becomes a loud, traceable one.
Installing it
Part of MD Nodes (MDMAchine/ComfyUI_MD_Nodes). ComfyUI Manager → search MD_Nodes → Install, restart, or:
cd path/to/ComfyUI/custom_nodes
git clone https://github.com/MDMAchine/ComfyUI_MD_Nodes.git
cd ComfyUI_MD_Nodes
pip install -r requirements.txt
Restart ComfyUI. Pure tensor scan, no extra dependencies beyond the pack. Python 3.10+, current ComfyUI, GPL v3.
Common issues
The main trap is treating Hard Clip as a fix instead of a rescue. Clipping is destructive - once the peaks are gone they're gone, so a render that comes out constantly clipping is a signal to fix the upstream (lower gain, tame the limiter, fix the latent shift) rather than to rely on this node every run. Also note the scan only checks the waveform tensor; if your audio dict is missing a waveform key entirely, the node logs a warning and passes through, so it won't rescue a structurally broken audio object - just a numerically bad one.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | INPUT AUDIO • Purpose: The generated audio waveform from AceT5 or decoders. • Range: Standard ComfyUI AUDIO dictionary. • Trade-offs: Protects speakers and muxers from blowing out. ⭐ Recommended: Connect before saving or playback nodes. | |
| action | COMBO | Hard Clip to [-1.0, 1.0] (Rescue) | DEFENSE ACTION • Purpose: Handle NaN, Inf, or volume clipping (>1.0 or <-1.0). • Options: - Hard Clip: Brutally slices off peaks to save your ears. - Mute Output: Turns the corrupted audio into complete silence. ⭐ Recommended: Hard Clip to [-1.0, 1.0] for safety. |
| debug_mode | COMBO | 0 - Silent | LOGGING VERBOSITY • Controls console output detail level. |
| enable_profiling | BOOLEAN | false | PERFORMANCE PROFILING • Enable detailed tensor scan timing. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |