MD: Mastering Compressor
Multiband compression for AI audio — tame the peaks without killing the punch
- audio
- AUDIO
Compression is where AI-generated audio either starts to sound "produced" or falls apart. MD_Mastering_Compressor is the dynamics stage of the MD mastering chain, and it does it properly: single-band or three-band multiband, with per-band threshold, ratio, attack, release, and makeup gain. It's the node that glues together the EQ'd mix and makes the loudness normalizer's job easy.
For AI music specifically, this matters more than you'd think. These models often pump or thump - one instrument grabs the dynamics and the whole track breathes with it. A multiband compressor lets you compress the low band without killing the vocal's transients up top, which is exactly the fix for "the kick drum is eating everything."
How it works
The node splits the work by comp_type. Single-Band treats the whole spectrum as one: everything above comp_threshold_db gets reduced by comp_ratio at comp_attack_ms/comp_release_ms speeds, with comp_makeup_gain_db bringing the level back up. Multiband splits the signal at two crossover frequencies (mb_crossover_low_mid_hz default 250 Hz, mb_crossover_mid_high_hz default 4000 Hz) into low/mid/high bands, each with its own threshold, ratio, attack, release, and makeup gain, then recombines. The crossover order controls how sharp the band separation is. All of it runs through the pack's DSP core on the waveform samples.
The inputs that matter
- comp_type - Single-Band or Multiband. Multiband is the default and the more useful one for music; switch to single for simple glue.
- comp_threshold_db / comp_ratio (single-band) - threshold at -8 dB, ratio 2.5:1 by default. Gentler than it sounds; that's a sensible starting point.
- mb_crossover_low_mid_hz / mb_crossover_mid_high_hz - where the bands split. 250/4000 is a standard music layout.
- mb_low_threshold_db / mb_low_ratio - the low band. Tighter threshold here tames boom and pumping.
- mb_high_threshold_db / mb_high_ratio - the high band; use it to control sibilance and harshness without dulling the mids.
- enable_comp - master on/off for the whole stage.
The per-band makeup gains default to 0; you'll add them back after listening. Output is a single AUDIO to continue into the limiter.
Installing
In the MD Nodes pack:
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
Or via ComfyUI Manager (MD Nodes), restart. The DSP core ships in-repo; the audio libraries in requirements back the pack's other audio nodes.
Common issues
The author's own launch post warned that mastering processing "can take a bit" - don't mistake slow renders for a hang on long files. And the classic compressor trap applies double here: makeup gain isn't a volume freebie. If you compress 6 dB and add 6 dB back, you've done nothing but add noise and squash transients. A common AI-music recipe: multiband, gently compress low band (3:1, -10 dB), leave mids almost untouched, then let the limiter catch the true peaks. Over-compressing is how you end up with a brick wall that the LUFS normalizer can't save.
Inputs (27)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | AUDIO INPUT | |
| sample_rate | INT | 441008000–192000 | SAMPLE RATE • Purpose: Fallback sample rate if not provided by audio dict. |
| enable_comp | BOOLEAN | true | ENABLE COMPRESSOR |
| comp_type | COMBO | Multiband | 2 options: Single-Band, Multiband |
| comp_threshold_db | FLOAT | -8.00-60–0 | — |
| comp_ratio | FLOAT | 2.501–20 | — |
| comp_attack_ms | FLOAT | 20.000.1–1000 | — |
| comp_release_ms | FLOAT | 250.001–5000 | — |
| comp_makeup_gain_db | FLOAT | 0.000–24 | — |
| mb_crossover_low_mid_hz | FLOAT | 250.00 | — |
| mb_crossover_mid_high_hz | FLOAT | 4000.00 | — |
| mb_crossover_order | INT | 8 | — |
| mb_low_threshold_db | FLOAT | -10.00-60–0 | — |
| mb_low_ratio | FLOAT | 3.00 | — |
| mb_low_attack_ms | FLOAT | 30.00 | — |
| mb_low_release_ms | FLOAT | 300.00 | — |
| mb_low_makeup_gain_db | FLOAT | 0.00 | — |
| mb_mid_threshold_db | FLOAT | -8.00-60–0 | — |
| mb_mid_ratio | FLOAT | 2.50 | — |
| mb_mid_attack_ms | FLOAT | 20.00 | — |
| mb_mid_release_ms | FLOAT | 180.00 | — |
| mb_mid_makeup_gain_db | FLOAT | 0.00 | — |
| mb_high_threshold_db | FLOAT | -6.00-60–0 | — |
| mb_high_ratio | FLOAT | 2.00 | — |
| mb_high_attack_ms | FLOAT | 10.00 | — |
| mb_high_release_ms | FLOAT | 120.00 | — |
| mb_high_makeup_gain_db | FLOAT | 0.00 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| AUDIO | AUDIO | — |