ComfyUI Node

Audio Silence Trim

Trim the dead air out of generated audio without making it sound rushed

By gaoqi125·Created 3 months ago·Updated 3 months ago· 0
Audio Silence Trim
  • audio
  • audio
  • report
keep_ratio0.50
max_keep_seconds0.30
silence_threshold_db-38
min_silence_seconds0.18
min_cut_seconds0.05

Ever generated a voiceover or an LTX-2 clip and gotten back a perfectly good take buried in three seconds of dead air between phrases? ComfyUI does a lot of things well, but tightening silence isn't one of them - the core AUDIO type gives you load, save, and not much else. Audio Silence Trim is a one-node answer: it shrinks long silent gaps in an AUDIO input while keeping a configurable slice of each gap, so the result sounds tightened instead of machine-gun chopped.

It's a small, new, MIT-licensed pack by Yang Li (gaoqi125), and it's exactly the kind of glue node the ecosystem runs on: no model downloads, no GPU, no API key, just a numpy loop over the waveform. You wire audio in, get tightened audio out.

How it works

The node is a plain energy gate, not a neural VAD - no Whisper, no ONNX, nothing to download. It converts your dB threshold into an amplitude value (10^(db/20)), computes the mean absolute amplitude per sample across all channels, and flags any run longer than min_silence_seconds where that amplitude stays under the threshold as a silence run.

For each run it applies the rule printed in its own report: kept_silence_seconds = min(original_silence_seconds * keep_ratio, max_keep_seconds). Then it splices the kept slices back together. Because it only needs numpy (torch is used opportunistically if it's already in your environment), it runs instantly on CPU and is fully deterministic - same input, same output, every batch.

The knobs that matter

There are five inputs, but you'll tune three of them and mostly leave the rest alone:

  • keep_ratio (default 0.5) - the fraction of each silence you keep. 0.5 is a good starting point; drop toward 0.2 if your pacing is still draggy, raise it if edits feel abrupt.
  • max_keep_seconds (default 0.3) - a hard cap on the silence retained per cut. This is what stops a 4-second pause from turning into a 2-second pause; a 4-second pause gets cut to 0.3s, not 2s.
  • silence_threshold_db (default −38) - how quiet "silent" means. More negative = less aggressive. −38 dB is genuinely quiet (about 0.013 amplitude), so it's a conservative default.
  • min_silence_seconds (0.18) - ignore gaps shorter than this.
  • min_cut_seconds (0.05) - if the amount a cut would remove falls below this, leave the whole gap alone. This protects micro-gaps from being shredded.

The two outputs are the trimmed audio (AUDIO) and report (a JSON string). The report is gold when you're dialing things in: input_seconds, output_seconds, removed_seconds, how many silences were detected vs. actually trimmed, and per-cut breakdowns. It's a plain string, so if you want it pretty, feed it to a string/JSON display node.

Install

ComfyUI Manager is the easy path - open it, search for comfyui-audio-silence-trim, install, restart. Or clone it by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/gaoqi125/comfyui-audio-silence-trim.git

Then restart ComfyUI. It shows up as Audio Silence Trim under the Audio category. There are no extra pip dependencies beyond numpy (already in every ComfyUI install), so this is about as painless as a custom node gets.

Where people get burned

The trap is forgetting this is an energy gate. Quiet speech or low background music sitting below your threshold reads as "silence," so if you've pushed silence_threshold_db up toward −20 and your voice suddenly sounds chopped, you've eaten the quiet parts of the take - go more negative instead. The flip side: if nothing is trimming at all, the defaults are working as intended, since −38 dB and a 0.18s minimum are conservative; lower the threshold or shrink min_silence_seconds.

Also remember it wants an AUDIO wire, not a VIDEO one. If your clip comes out of an image/video model, extract the audio first (a Load Audio node or VideoHelperSuite audio extract), trim, then re-mux. Audio generation models like LTX-2 emit audio natively; for something like Wan, which has no native audio, you'd add an MMAudio or LTX stage anyway - which is precisely when a clip full of awkward gaps shows up and this node earns its keep.

CategoryAudio

Inputs (6)

NameTypeDefaultDescription
audioAUDIO
keep_ratioFLOAT0.500–1
max_keep_secondsFLOAT0.300.01–2
silence_threshold_dbFLOAT-38-80–-10
min_silence_secondsFLOAT0.180.01–2
min_cut_secondsFLOAT0.050–1

Outputs (2)

NameTypeDescription
audioAUDIO
reportSTRING