Nodes/VRGameDevGirl Video Enhancement Nodes/VRGDG Build Overlap Audio Window
ComfyUI Node

VRGDG Build Overlap Audio Window

Keeping the soundtrack in sync when you batch a long video

By vrgamegirl19·Created about a year ago·Updated about 7 hours ago· 718
VRGDG Build Overlap Audio Window
  • audio
  • video_info
  • overlap_info
  • window_audio

Video models like MiniMax H3 and LTX 2.3 generate audio with the picture, which is a blessing until you try to process a long clip in overlapping windows. Slice the frames into batches and the soundtrack has to be sliced to the exact same window, or the model gets audio that doesn't match the frames it's looking at - and out pops audio drift you'll hear instantly. VRGDGOverlapAudioWindow is the node that keeps the two aligned. It's one tool in the VRGameDevGirl overlap meta-batch set for memory-conscious long-video processing, and it exists because when you batch a video, someone has to do the same bookkeeping for the audio.

The context: overlap windows with synthetic frames

The pack's overlap system (all under the VRGDG/Video/Meta Batch category) is built on VideoHelperSuite's native meta-batch. You set a window/overlap/stride with VRGDG Overlap Preset - the H3 presets are 39/5, 73/17, and 124/22, and windows must follow 17n+5 - then feed the stride as frames_per_batch into the standard VHS Batch Manager. VRGDG Build Overlap Window assembles each batch: on the first pass it prepends synthetic frames (the first real frame repeated) so the model sees its full window, and on the last pass it pads the tail with repeated frames. Later, VRGDG Blend Overlap Output crossfades the overlapping processed frames back into one continuous clip.

Those synthetic leading and trailing frames are the whole reason this node exists. They have no real footage behind them - the song at that moment belongs to a different part of the timeline. So VRGDGOverlapAudioWindow slices the source soundtrack to the exact window being processed and writes silence over any range that falls outside the real audio. The model gets video frames plus an audio track whose silent edges match its synthetic frames, and the real frames in the middle get their true, correctly-timed audio.

How it slices

Given the full audio waveform, the video_info from your VHS video loader (for the frame rate), and the overlap_info dict from VRGDG Build Overlap Window, it computes:

start_frame = batch_index * stride - overlap

converts frames to samples at sample_rate / fps, allocates a zero-filled output of exactly window frames of audio, and copies in only the portion of the source waveform that actually falls inside the window. Everything before the clip's true start or past its end stays silent.

The math is done in samples, so it stays frame-accurate even at awkward frame counts. Note the node also marks itself always-changed (IS_CHANGED returns NaN), which matters: it must re-run fresh on every batch pass rather than caching a stale slice.

Inputs and outputs

No widgets at all - it's pure plumbing between three required inputs:

  • audio (AUDIO) - the full source soundtrack, straight from a VHS or VRGDG audio loader.
  • video_info (VHS_VIDEOINFO) - from the VHS video loader that's feeding your frames.
  • overlap_info (VRGDG_OVERLAP_INFO) - from the VRGDG Build Overlap Window node, which knows the current batch_index, window, overlap, and stride.

The single output, window_audio, is an AUDIO tensor matching the exact window of frames being sent to the model - wire it into the model's audio conditioning input right where window_images goes in for video.

Install

Same pack as the rest of the VRGameDevGirl suite, and it needs to be a working one:

cd ComfyUI/custom_nodes
git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl.git

Restart and hard-refresh. But this node also hard-depends on VideoHelperSuite (VHS) - it consumes VHS_VIDEOINFO and the VHS Batch Manager - so install that too if you haven't. ComfyUI Manager handles both. The pack's requirements.txt pulls in heavy extras (voxcpm, llama-cpp-python, demucs, …) that aren't needed for the overlap nodes themselves.

Common issues

  • "Overlap Audio Window requires overlap_info from VRGDG Overlap Window" - you're feeding a random dict in, not the output of the window builder. Re-wire.
  • "Overlap Audio Window requires video_info from the VHS video loader" - you grabbed the wrong output from VHS, or didn't use VHS at all. This node won't work with a plain frame loader.
  • "The VHS video loader reported an invalid loaded frame rate" - your loader reported no/zero fps, so frame-to-sample conversion is impossible. Recheck the video loader settings.
  • Audio and video drift anyway - the stride feeding the VHS Batch Manager must match the stride in the overlap preset exactly, or every batch after the first lands on the wrong audio. The whole family is finicky about that one number; when in doubt, reset and re-queue the workflow so the batch state starts clean.
CategoryVRGDG/Video/Meta Batch

Inputs (3)

NameTypeDefaultDescription
audioAUDIO
video_infoVHS_VIDEOINFO
overlap_infoVRGDG_OVERLAP_INFO

Outputs (1)

NameTypeDescription
window_audioAUDIO