Audio - Add Silence
Audio - Add Silence in ComfyUI
- audio
- audio
Most of the time you're fighting to remove silence from a clip. This node is for the rare occasion you want to add it on purpose. Audio - Add Silence (from the tiny scofano/comfy-audio-duration pack) takes an AUDIO object and sticks zero-valued samples on the front, the back, or both. That's the entire job. No editor round-trip, no ffmpeg incantation, no detour through Audacity - you just wire it inline and the audio comes out padded.
Why would you ever want dead air? If you're doing video or audio generation with something like LTX-Video or Wan Audio, the model is often picky about clip length and start points. Prepending a couple hundred milliseconds of silence is a cheap way to give a text-to-video model a lead-in before the audio actually starts, or to pad a short clip up to the minimum length a workflow expects. If you've ever seen a workflow with a "2 second filler" baked in to keep a generation in sync, this is the same trick in node form - except now it's adjustable per run instead of hardcoded.
What it actually does
The mechanism is embarrassingly simple, which is why it works. ComfyUI's AUDIO type is just a dict holding a waveform tensor and a sample_rate. The node takes your milliseconds, converts them to sample frames (ms / 1000 × sample_rate), builds zero-filled tensors in the same shape, and concatenates them onto the start and/or end of the waveform.
Two details are worth knowing:
- It pads on the last dimension, so batch and channel layout (mono vs. stereo) are preserved - you won't accidentally turn stereo into one long mono track.
- If both silence values are
0, it returns your audio completely untouched. Handy as a "maybe bypass" if you want to flip padding on and off without rewiring the graph.
And here's the quiet part: this node needs none of the pack's scary dependencies. The scipy and ffprobe requirements in the README belong to the pack's other node (Audio Duration, which probes files). Add Silence is pure PyTorch on an already-loaded audio tensor, so once the pack is installed it just runs.
The inputs that matter
There are only three inputs, all required in the graph but with sane defaults:
audio(AUDIO) - whatever upstream node produced your audio. Any node that outputs the standardAUDIOtype works.prepend_silence(FLOAT) - silence before the audio, in milliseconds. Default100, min0, max600000(ten minutes, so no, you won't hit it).append_silence(FLOAT) - silence after the audio, also milliseconds. Default200.
The single output is audio, a new AUDIO object you can feed straight into an encoder, a VAE, or the next node in the chain.
Installing it
Easiest route is ComfyUI Manager: search for Audio Duration (the pack title) and install. Or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/scofano/comfy-audio-duration
Then restart ComfyUI. The pack's requirements.txt pulls in numpy and scipy; numpy is already in every ComfyUI, and scipy is only exercised by the Duration node, but let pip install it anyway so the whole pack works.
Where people get burned
This node's errors are mostly from the sibling node, so read them carefully. If you hit RuntimeError: Expected AUDIO input to be a dictionary-like audio object or the "must contain both 'waveform' and 'sample_rate'" message, the thing feeding you isn't producing a proper AUDIO object - check the upstream node actually loaded its file. The ffprobe not found and scipy not found errors in the README are from Audio Duration, not this node.
The one genuinely annoying gotcha is Windows portable builds: if you manually cloned and see IMPORT FAILED or a node that reads 0.0, Python can't import a folder whose name has hyphens (comfy-audio-duration). Rename the folder to comfy_audio_duration or AudioDurationNode and restart. Manager installs don't usually hit this, which is another argument for using it.
It's a boring utility node - and that's a compliment. It does one thing, does it on the GPU where your waveform already lives, and gets out of the way.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | — | |
| prepend_silence | FLOAT | 1000–600000 | — |
| append_silence | FLOAT | 2000–600000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |