๐ VRGDG_CombinevideosV2
Stitch up to 16 scene clips into one video, each trimmed to its song duration
- 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
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.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| fps | FLOAT | 25.00 | โ |
| audio_meta | DICT | โ | |
| video_1opt | IMAGE | โ | |
| video_2opt | IMAGE | โ | |
| video_3opt | IMAGE | โ | |
| video_4opt | IMAGE | โ | |
| video_5opt | IMAGE | โ | |
| video_6opt | IMAGE | โ | |
| video_7opt | IMAGE | โ | |
| video_8opt | IMAGE | โ | |
| video_9opt | IMAGE | โ | |
| video_10opt | IMAGE | โ | |
| video_11opt | IMAGE | โ | |
| video_12opt | IMAGE | โ | |
| video_13opt | IMAGE | โ | |
| video_14opt | IMAGE | โ | |
| video_15opt | IMAGE | โ | |
| video_16opt | IMAGE | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| blended_video_frames | IMAGE | โ |