ComfyUI Node

Audio Null Test

Subtract two files and see exactly what the processor changed

By lucasgattas·Created about a year ago·Updated 8 months ago· 61
Audio Null Test
  • audio_ref
  • audio_proc_aligned_matched
  • audio_null
  • metrics
◄invert_btrue►
◄least_squares_scalefalse►
◄compute_corrtrue►
◄compute_null_rmstrue►
◄compute_null_lufstrue►
◄compute_lsdtrue►
◄compute_hf_residualfalse►
◄n_fft2048►
◄hop512►
◄hf_band_hz8000►

The null test is the most honest tool in audio, and it's absurdly simple: take your reference, invert the processed version, add them together, and whatever's left is exactly what the processor changed. If the result is silence, the processor was transparent. If it's a noise floor, that's your added noise. If it's a mess of signal, the processor is doing more than you thought. This node is the subtraction-and-measure step of the Egregora null-test suite.

Crucially, it expects its second input to be already aligned and gain-matched - that's why the input is named audio_proc_aligned_matched. Feed it raw, misaligned audio and the null result will be dominated by timing and level errors rather than actual processor changes. The suite's Full node does all three stages for you; this node is the measurement stage in isolation, which is exactly what you want when you're iterating on settings and already have alignment solved.

How it works

The node subtracts the (inverted) processed audio from the reference - invert_b defaults on, meaning "A minus B" - and then computes whatever metrics you've enabled. The interesting bit is the metric selection, because each one tells you something different:

  • corr_coef - waveform correlation. 1.0 is perfect transparency.
  • null_rms_dbfs - how much residual energy the subtraction left, in dB. Lower is more transparent.
  • null_lufs - the same residual measured as loudness, which is a more perceptual view.
  • lsd_mean_db / lsd_p95_db - spectral distance of the residual; catches frequency-shaped differences.
  • hf_residual_db - energy in a high band (default 8 kHz and up) of the null. This is the one that catches "the processor shaved off the top end," a change that's easy to miss in a full-band number.

There's also a least_squares_scale option that fits a best-scale factor before subtracting - useful if your gain matching was imperfect and you want the null to reflect only the non-linear changes.

The inputs that matter

  • audio_ref - the original.
  • audio_proc_aligned_matched - processed, aligned, and gain-matched audio.
  • invert_b (default on) - leave it, unless you've already inverted the signal yourself.
  • compute_* toggles - keep compute_null_rms and compute_lsd on; enable compute_hf_residual if you suspect top-end damage.
  • n_fft / hop - STFT settings for the LSD calculation (defaults 2048/512 are fine).

Outputs: audio_null (the residual - you can listen to it!) and a metrics DICT.

The take

Listening to the audio_null output is the pro move: a transparent processor should sound like near-silence or faint room tone, while a lossy codec sounds like the codec's characteristic shimmer. It's the difference between reading a number and hearing exactly what your chain did. No extra install beyond the pack - pure NumPy. Use it as the final verdict on any FlashSR, Fat Llama, or codec experiment.

CategoryEgregora/Analysis

Inputs (12)

NameTypeDefaultDescription
audio_refAUDIO—
audio_proc_aligned_matchedAUDIO—
invert_boptBOOLEANtrue—
least_squares_scaleoptBOOLEANfalse—
compute_corroptBOOLEANtrue—
compute_null_rmsoptBOOLEANtrue—
compute_null_lufsoptBOOLEANtrue—
compute_lsdoptBOOLEANtrue—
compute_hf_residualoptBOOLEANfalse—
n_fftoptINT2048512–8192—
hopoptINT51264–4096—
hf_band_hzoptINT80001000–20000—

Outputs (2)

NameTypeDescription
audio_nullAUDIO—
metricsDICT—