Nodes/VRGameDevGirl Video Enhancement Nodes/๐ŸŒ€ VRGDG_CombinevideosV2
ComfyUI Node

๐ŸŒ€ VRGDG_CombinevideosV2

Stitch up to 16 scene clips into one video, each trimmed to its song duration

By vrgamegirl19ยทCreated about a year agoยทUpdated about 20 hours agoยท 682
๐ŸŒ€ VRGDG_CombinevideosV2
  • audio_meta
  • video_1
  • video_2
  • video_3
  • video_4
  • video_5
  • video_6
  • video_7
  • video_8
  • video_9
  • video_10
  • video_11
  • video_12
  • video_13
  • video_14
  • video_15
  • video_16
  • blended_video_frames
โ—„fps25.00โ–บ

After the 16 scene videos for a set have been generated, something has to turn them into one continuous clip where each scene is exactly as long as its section of the song. That's VRGDG_CombinevideosV2. It takes up to 16 IMAGE "videos" plus an audio_meta dict, and trims or pads each one to the duration that audio_meta specifies for its slot, then concatenates them into a single frame sequence at the given FPS.

This is the per-set assembler in the music-video pipeline - the counterpart to CalculateSetsFromAudio_Queue, which produces the audio_meta that this node consumes. Generate 16 short scene clips, feed them all in, and out comes one set-length video with the pacing locked to the music.

How it works

The mechanism is straightforward and honest about its limits. Each video slot has a target duration from audio_meta["durations"] (a list, one entry per scene). The target frame count is duration * fps (rounded). A video longer than its target gets trimmed to the target; a video shorter than its target gets padded by repeating its last frame until it reaches the target; and if a slot has no duration data (or a zero), the video keeps its own length. Then all the trimmed/padded tensors are concatenated frame-wise into one blended_video_frames tensor.

The last-frame-repeat padding is the pragmatic choice - freeze-frame is far less jarring than a black gap, and it means short generations don't break the timeline. Just be aware that a badly short scene will visibly hold its final frame rather than reveal a problem.

Inputs

  • fps (default 25) - the timeline FPS. Should match what your generator used.
  • audio_meta (DICT, required) - the durations list that drives trimming.
  • video_1 โ€ฆ video_16 (optional IMAGE) - the scene clips. At least one is required, and any not connected are simply skipped.

Output: blended_video_frames, a single IMAGE tensor (frames, H, W, C) that you'd feed to a VHS Combine Video or Save Video node to actually write the MP4.

Gotchas and install

The duration math is only as good as audio_meta. If you connect a dict without a durations key, the node falls back to keeping every video at its native length - no error, just no trimming, so a missing-key bug shows up as "everything's the wrong length" rather than a crash. The 16-slot limit is also fixed: a 17-scene set needs two runs. And there's a subtle assumption that all connected videos share the same resolution and format - concatenation doesn't resize anything, so mismatched resolutions will break the downstream save node.

Install: ComfyUI Manager โ†’ search "vrgamedev", or git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl into ComfyUI/custom_nodes, restart. The pack's kornia, librosa, imageio requirements apply. If you want label bars and per-set MP4 saving, the pack's VRGDG_CombinevideosV5 is the newer sibling - this V2 is the leaner, no-frills version.

CategoryVideo

Inputs (18)

NameTypeDefaultDescription
fpsFLOAT25.00โ€”
audio_metaDICTโ€”
video_1optIMAGEโ€”
video_2optIMAGEโ€”
video_3optIMAGEโ€”
video_4optIMAGEโ€”
video_5optIMAGEโ€”
video_6optIMAGEโ€”
video_7optIMAGEโ€”
video_8optIMAGEโ€”
video_9optIMAGEโ€”
video_10optIMAGEโ€”
video_11optIMAGEโ€”
video_12optIMAGEโ€”
video_13optIMAGEโ€”
video_14optIMAGEโ€”
video_15optIMAGEโ€”
video_16optIMAGEโ€”

Outputs (1)

NameTypeDescription
blended_video_framesIMAGEโ€”