Dynamic Range Compressor (S42)
The S42 compressor with the four knobs that matter
- audio
- AUDIO
Compression is the boring-but-necessary part of making generated audio not sound like it was recorded in a hallway. S42_DynamicRangeCompressor is a straightforward, four-knob compressor that glues a voiceover, evens out an LTX-2.3-generated music bed, or tames a mix before you send it to a video. It's the kind of node you reach for after generation, at the "make it sound intentional" stage.
Unlike most of the pack's audio stuff, this one doesn't pretend to be doing exotic math - it's a real, recognizable compressor with threshold, ratio, attack, and release. The heavy lifting is delegated to SoX via torchaudio.sox_effects, which is bundled with ComfyUI.
How it works
Under the hood it calls SoX's compand effect with your parameters: compand attack,release <threshold curve> 0 -90 0.1. The threshold curve means "below -90dB nothing happens, above threshold_db it compresses at 1/ratio." In plain terms: quiet parts pass untouched, loud parts get turned down proportional to how far over the threshold they go, with attack and release shaping how fast that gain reduction kicks in and lets go.
A genuinely nice detail: if SoX fails for any reason, the node catches the error, prints a console note, and passes your audio through unchanged instead of crashing your whole workflow. No silent data corruption.
The inputs
audio- the track to compress.threshold_db- default -12, range -60 to 0. The level where compression starts. Higher (closer to 0) = less gets compressed; lower = the whole track gets squeezed.ratio- default 4 (4:1). 2:1 is gentle glue; 8:1+ starts to sound like a limiter.attack_ms- default 5. Fast attack catches transients; slower lets drum hits punch through.release_ms- default 50. Short release can pump; long release can sound "stuck."
For a voiceover, a common start is threshold -20, ratio 3, attack 5ms, release 80ms. For music, -12 with ratio 2–4 is a decent glue setting.
Output
A single AUDIO out. No info, no meters - you're flying by ear, so pair it with a preview/playback node or just trust it and A/B it.
Installing it
Standard S42 CutFlow install: ComfyUI Manager → search "S42 CutFlow", or git clone https://github.com/GeekyGhost/S42-CutFlow into ComfyUI/custom_nodes/, install requirements, restart. The SoX effects backend rides along with torchaudio, which is included in the portable build.
Gotchas
There's no makeup gain here - compression turns things down, so the output will often be quieter than the input. Plan for that in your chain (a normalize step after it, or the pack's audio nodes that do level matching). And because the threshold curve is hard-coded to -90, extremely quiet material that never reaches the threshold gets no compression at all - which is correct behavior, just easy to mistake for the node being broken. If nothing seems to change, check that your peaks are actually crossing the threshold.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | Input audio to compress. | |
| threshold_db | FLOAT | -12.0-60–0 | — |
| ratio | FLOAT | 4.01–20 | — |
| attack_ms | FLOAT | 5.00.1–100 | — |
| release_ms | FLOAT | 5010–1000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| AUDIO | AUDIO | — |