Nodes/ComfyUI_AIMZ/AIMZ Audio Silence Pad
ComfyUI Node

AIMZ Audio Silence Pad

Audio that stays in sync when you pad the video

By AIMZ-GFX·Created 28 days ago·Updated 17 days ago· 3
AIMZ Audio Silence Pad
  • audio
  • audio
  • total_duration
  • pad_start_sec
  • pad_end_sec
pad_start_frames15
pad_end_frames15
default_fps24
source_fps

You pad a video with extra frames at the start - say 15 freeze frames so MiniMax H3 gets its motion buffer - and suddenly the audio starts half a beat early and never lines up again. The fix sounds trivial: add pad_frames / fps seconds of silence to the front of the audio. Doing it by hand in ComfyUI is not. It takes two Int nodes, two Math Expression nodes, two Empty Audio nodes, two Concatenate Audio nodes, and they all have to agree on sample rate or you get drift. AIMZ Audio Silence Pad is that whole tower in one node, with the arithmetic already done.

How it works

The node takes the number of frames you're padding and converts them to seconds using the video FPS - pad_start_frames / fps. Then it converts that to an exact sample count with your audio's sample rate: round(seconds * sample_rate), builds a zero tensor of that many samples, and concatenates it onto the front and back of the waveform. Because the sample count is computed from your actual sample rate rather than assumed, a 48 kHz track stays exactly 48 kHz worth of silence. No drift, no rounding arguments with your downstream mixer.

The FPS side is smarter than it has to be. If you feed the source_fps input (from a Get_FPS node or your video loader), it uses that. Leave it unplugged and it falls back to default_fps, which defaults to 24. The one thing to remember: pad_start_frames and pad_end_frames are video frames, not audio samples. If you pad the video with 15 frames, feed this node 15 too, and everything matches.

The inputs and outputs that matter

You set three things: pad_start_frames, pad_end_frames, and default_fps. The optional audio input takes the AUDIO dict from any ComfyUI audio node ({'waveform': tensor, 'sample_rate': int}), and source_fps overrides default_fps when connected.

Out the other side you get the padded audio dict, a total_duration float (handy for feeding a duration-aware downstream node), and pad_start_sec / pad_end_sec showing exactly how many seconds were added on each side. The duration outputs are genuinely useful if you're chaining video and audio into the same export.

Installing it

This ships in the ComfyUI_AIMZ pack. Easiest path:

  1. Open ComfyUI Manager → Custom Nodes Manager.
  2. Search comfyui_aimz or AIMZ, hit Install, restart ComfyUI.

Or clone it manually:

cd ComfyUI/custom_nodes
git clone https://github.com/AIMZ-GFX/ComfyUI_AIMZ.git

No model downloads, no extra requirements beyond what ComfyUI already ships (torch/numpy/pillow). You're up in one restart.

Gotchas

  • If audio is None - an empty branch, or a node upstream that legitimately produced nothing - the node passes through None and 0.0 durations instead of crashing. That's deliberate "None-safe" behavior, and it's the whole design philosophy of this pack. It only helps if whatever you wire the output into can also tolerate None.
  • The audio input is optional, but it's not a magic audio loader. You still need a node upstream that produces an AUDIO dict. This node only pads.
  • If your audio and video sample rates disagree because you never connected source_fps, you get 24 fps math silently. For anything synced, wire the real FPS in.

It's a small utility, but it's the kind of small utility that quietly deletes four nodes from every V2V workflow you'll ever build.

CategoryAIMZ/Audio

Inputs (5)

NameTypeDefaultDescription
pad_start_framesINT150–10000Number of frames to pad with silence at the start
pad_end_framesINT150–10000Number of frames to pad with silence at the end
default_fpsFLOAT241–240Default FPS used when source_fps is not connected
audiooptAUDIOInput audio dictionary {'waveform': tensor, 'sample_rate': int}. If None, returns None without error.
source_fpsoptFLOATOptional source video FPS (from Get_FPS or video loader, overrides default_fps)

Outputs (4)

NameTypeDescription
audioAUDIO
total_durationFLOAT
pad_start_secFLOAT
pad_end_secFLOAT