Nodes/VRGameDevGirl Video Enhancement Nodes/VRGDG_CalculateSetsFromAudio_Queue
ComfyUI Node

VRGDG_CalculateSetsFromAudio_Queue

The queue-aware version of the set math — it hands other nodes everything they need

By vrgamegirl19·Created about a year ago·Updated 2 days ago· 717
VRGDG_CalculateSetsFromAudio_Queue
  • audio
  • instructions
  • end_time
  • total_sets
  • groups_in_last_set
  • frames_per_scene
  • audio_meta
index0

Same family as VRGDG_CalculateSetsFromAudio, but where that node hands a human a checklist, this one hands the graph a data packet. It does the same 62-second-set / 16-group scheduling math with frame-exact precision, and then returns everything downstream needs to actually build those sets - including the audio_meta dict that the pack's combine nodes consume to trim each scene to its exact length.

The newer part is frame-exactness. It works at 25fps with a hardcoded 97 frames per scene (3.88s × 25) and computes durations in frames rather than rough seconds: total_audio_frames = num_samples // 1920 (1920 = samples per frame at 48kHz), then splits into full 97-frame groups with any leftover becoming the final partial group. frames_per_scene is reported as 97, groups_in_last_set tells you how many groups the ragged final set has, and audio_meta bundles the per-scene frame durations that VRGDG_CombinevideosV2/V5 use to trim each generated video to its scene length.

Outputs - the full set

  • instructions - text saying how many runs are needed and which groups to enable (the same human checklist, but with "already queued automatically" notes for full sets).
  • end_time - total track length as MM:SS.
  • total_sets - number of 62-second runs required.
  • groups_in_last_set - how many groups the final partial set contains (16 if it's a full set).
  • frames_per_scene - 97 at 25fps.
  • audio_meta - the DICT that drives the combine nodes. This is the output everything else waits on.

Inputs are just audio and index (the current set, 0-based), same as the plain version.

How it fits

In the queue-driven workflow, this node replaces the "read the instructions, click Run, toggle groups" loop with something closer to automation: full sets get queued automatically, and only the final ragged set needs you to enable the right groups and hit Run once. Its audio_meta output is the thread that ties the whole chain together - calculate sets → generate the 16 scene videos → VRGDG_CombinevideosV5 reads audio_meta to know how long each scene must be → VRGDG_CreateFinalVideo_SRT concatenates and re-attaches audio. If a set comes out wrong, check audio_meta first, because every downstream length decision comes from it.

Install and gotchas

Same pack install as always: ComfyUI Manager → search "vrgamedev", or git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl into ComfyUI/custom_nodes, restart. The audio you feed it should be clean and frame-aligned - run VRGDG_CleanAudio first so the sample count lands on the 1920-sample grid, otherwise the frame math drifts a frame or two across a long track. That drift is small per set but compounds over a 4-minute song, and it's exactly the kind of thing that shows up as "the last scene cuts a frame early" with no obvious cause.

Categoryutils/audio

Inputs (2)

NameTypeDefaultDescription
audioAUDIO
indexINT0

Outputs (6)

NameTypeDescription
instructionsSTRING
end_timeSTRING
total_setsINT
groups_in_last_setINT
frames_per_sceneINT
audio_metaDICT