Nodes/Boyonodes/Boyo Audio Padder (Debug)
ComfyUI Node

Boyo Audio Padder (Debug)

Pad your TTS audio to the video's exact length

By DragonDiffusionbyBoyo·Created 2 years ago·Updated 27 days ago· 16
Boyo Audio Padder (Debug)
  • audio
  • padded_audio
  • total_duration
  • status_text
pre_pad_seconds0.0
post_pad_seconds0.0
target_duration0.0
auto_centerfalse

Every lip-sync pipeline hits the same wall: your TTS generates speech, your video model renders a clip, and the speech is shorter than the clip. What do you do with the gap? If you do nothing, the audio just ends early and the character's mouth keeps moving in silence. If you pad, the timing lines up. Boyo Audio Padder is the padding node, and its whole reason for existing is that ComfyUI's standard audio handling doesn't give you an easy "make this audio exactly N seconds long" step.

The "(Debug)" in the display name is accurate but doesn't mean it's broken - it means the author left the logging turned up to eleven. Every stage of the padding process prints a full debug dump to the console: tensor shapes, sample rates, min/max values, durations. In normal use it's just noisy; when your audio is doing something weird, that verbosity is actually how you diagnose it.

How it works

You feed it an AUDIO tensor and it appends (and/or prepends) digital silence. The mechanism is straightforward torchaudio functional padding after it normalizes whatever shape the audio arrives in - it handles (batch, channels, samples), (batch, samples, channels), tuples, and plain tensors, then reshapes to a standard format before padding.

Three ways to use it:

  • pre_pad_seconds and post_pad_seconds - fixed amounts of silence before and after. The basic manual approach.
  • target_duration (optional) - the good one. Set a target in seconds and the node pads to reach it. This is what you want for lip-sync: generate speech, measure it (Boyo Audio Duration Analyzer is the natural measuring partner, though any source works), set target_duration to the video length, done.
  • auto_center (optional) - when set, padding is split equally before and after instead of dumped all at the end. Nicer for a sound bed or music track; unnecessary for speech.

Outputs are padded_audio (AUDIO), total_duration (FLOAT) so you can verify the result, and status_text (STRING) with the human-readable summary.

Setup

cd ComfyUI/custom_nodes && git clone https://github.com/DragonDiffusionbyBoyo/Boyonodes
pip install torchaudio soundfile

restart, and it's under Boyo/Audio/Processing. torchaudio is a ComfyUI prerequisite in most installs already; soundfile is the pack's audio-dependency addition.

The workflow it's built for

Chatterbox Turbo Generate → Boyo Audio Duration Analyzer → Boyo Audio Padder
                                                                   (target_duration = video length)
                                                                           ↓
                                                                     Save Audio

That's the author's stated happy path, and it's a good one: generate, measure, pad to match, save. The total_duration output exists precisely so you can confirm the pad worked and your video length and audio length are the same number.

One trap worth naming: the node refuses to proceed if it can't find a sample rate in the audio metadata - it raises rather than guess, because padding with the wrong rate corrupts timing. If you hit that error, the fix is upstream: make sure whatever produced the audio attached its sample rate. It's annoying, but it's the node refusing to lie to you, and that's the right failure mode for a timing tool.

CategoryBoyo/Audio/Processing

Inputs (5)

NameTypeDefaultDescription
audioAUDIO
pre_pad_secondsFLOAT0.00–300
post_pad_secondsFLOAT0.00–300
target_durationoptFLOAT0.00–300
auto_centeroptBOOLEANfalse

Outputs (3)

NameTypeDescription
padded_audioAUDIO
total_durationFLOAT
status_textSTRING