Nodes/MediaForge/🀫 Detect Silence
ComfyUI Node

🀫 Detect Silence

Auto-cut the dead air out of a lecture or podcast before you edit anything

By leon80148Β·Created 4 months agoΒ·Updated 2 months agoΒ· 0
🀫 Detect Silence
  • audio
  • ranges
  • ranges_json
  • count
β—„audio_sourceinput/sample.mp4β–Ί
β—„noise_db-30.0β–Ί
β—„min_duration_sec0.50β–Ί

MF_DetectSilence finds the silent stretches in an audio track and returns them as a list of time ranges - which is the first half of the most useful automatable workflow in this pack: detect silence, then trim it out. Wire its ranges output into MF_TrimByRanges with mode=remove, and a 45-minute lecture recording sheds its dead air in one run. It's the canonical upstream for the trimmer, and it's genuinely good at the job.

It's an analysis node - it never writes a file. It just tells you where the silence is. The ranges_json output exists precisely so you can eyeball what it found before you commit to cutting, which you should, because silence detection has opinions and they're not always yours.

How it works

It's an FFmpeg silencedetect wrapper. That filter watches the audio level and reports when it stays below a threshold (noise_db, in dB) for at least a minimum duration (min_duration_sec). The two knobs are the whole tuning story: the threshold decides how quiet counts as silence, and the minimum duration decides how long it has to be quiet before it's worth cutting.

The inputs that matter

  • noise_db - the level below which audio counts as silent. Default -30. Less negative (-20) = more aggressive, treats quiet-ish room tone as silence; more negative (-40) = stricter, only true silence counts.
  • min_duration_sec - default 0.5. Shorter gaps get treated as natural pauses between words and ignored. Raise it to 1–2s if you're cutting a lecture where people pause to think; the readme's tuning guide is solid: podcast -30/0.5, lecture with fan hum -25/1.0, music with quiet passages -50/2.0.

There's also a dual-input path: wire an audio AUDIO dict (from MF_LoadVideoFrames) and it overrides audio_source, so you can detect silence on an in-memory audio tensor without a file round-trip.

Outputs: ranges (SILENCE_RANGES β†’ MF_TrimByRanges.ranges), ranges_json (debug string), count (how many silent regions were found).

Install

Part of MediaForge:

cd ComfyUI/custom_nodes
git clone https://github.com/leon80148/comfyui_MediaForge.git
# restart ComfyUI

Or ComfyUI Manager β†’ "MediaForge".

Common issues

Getting a surprising count is the normal experience - room hum, HVAC, or a loud-whisper presenter all defeat the default -30. This is the one node where you should trust the ranges_json output and tune rather than assume the node is broken. Also note it detects audio silence only; a video that's silent but visually active will still report silence. And if you wire mode=remove with an empty range list into the trimmer, that's the identity case (nothing removed) - which is usually a sign your threshold was too strict, not a bug.

CategoryMediaForge/Analysis

Inputs (4)

NameTypeDefaultDescription
audio_sourceSTRINGinput/sample.mp4β€”
noise_dbFLOAT-30.0-90–0β€”
min_duration_secFLOAT0.500.05–60β€”
audiooptAUDIOβ€”

Outputs (3)

NameTypeDescription
rangesSILENCE_RANGESβ€”
ranges_jsonSTRINGβ€”
countINTβ€”