Nodes/ComfyUI · Egregora Audio Super‑Resolution/Egregora Metrics (LSD + SI-SDR)
ComfyUI Node

Egregora Metrics (LSD + SI-SDR)

The numbers that tell you if your enhancement actually helped

By lucasgattas·Created 12 months ago·Updated 7 months ago· 60
Egregora Metrics (LSD + SI-SDR)
  • audio_ref
  • audio_proc
  • metrics
n_fft2048
hop512
compute_lsdtrue
compute_si_sdrtrue

This node is where the Egregora pack stops asking you to trust it and starts showing receipts. Feed it a reference audio and a processed audio, and it returns two numbers that measure how far apart they are - Log-Spectral Distance (LSD) and Scale-Invariant Signal-to-Distortion Ratio (SI-SDR). If you're going to use FlashSR or Fat Llama on anything, this is the node that tells you whether you made the audio closer to your target or farther from it.

Quick decoder ring for the metrics:

  • LSD (log-spectral distance) is a frequency-domain error: it compares the magnitude spectra frame by frame and reports the average distance in dB. Lower = the two signals' spectra are closer. It's a good "how similar does it sound" measure because it cares about the spectral shape, not the exact waveform. The node reports lsd_mean_db and lsd_p95_db (the 95th percentile, which catches the worst frames rather than hiding them in an average).
  • SI-SDR (scale-invariant signal-to-distortion ratio) is a time-domain measure in dB. Higher = better. The "scale-invariant" part means it's robust to gain differences - which is exactly why this pack pairs it with gain matching, because if you compare an un-matched processed file, SI-SDR punishes the level difference even when the content is fine.

Used together they cover both domains: LSD catches spectral changes, SI-SDR catches additive distortion and artifacts.

The inputs

  • audio_ref - your reference (ideally the original).
  • audio_proc - the processed output.
  • n_fft (default 2048) and hop (default 512) - STFT resolution for the LSD calculation. Defaults are fine for most material.
  • compute_lsd and compute_si_sdr - both on by default; flip one off if you only need the other and want it a hair faster.

Output is a metrics DICT with the requested values. There's no audio output - this is a pure measurement node, the end of an evaluation chain.

How to use it properly

The move that makes this node useful rather than decorative: gain-match first. Run the original and processed through Audio Gain Match (or the 1770 variant) before comparing, so SI-SDR isn't punishing a level difference. And always compare against the same reference - the metric is only meaningful relative to what you're trying to approach. If you're testing a denoiser, the noisy original is the wrong reference; use a clean version if you have one, or accept that you're measuring "closer to noisy original."

Install and the take

Pure NumPy/SciPy inside the eval pack - no model downloads, no extra heavy deps. It's one of the zero-friction nodes in this pack, and it's the one that makes all the friction of the enhancement nodes worth it. Don't skip it because it's "boring math": the difference between "sounds different" and "is actually better" is a number, and this is the number.

CategoryEgregora/Analysis

Inputs (6)

NameTypeDefaultDescription
audio_refAUDIO
audio_procAUDIO
n_fftoptINT2048512–8192
hopoptINT51264–4096
compute_lsdoptBOOLEANtrue
compute_si_sdroptBOOLEANtrue

Outputs (1)

NameTypeDescription
metricsDICT