๐ง VRGDG_CalculateSetsFromAudio
How many 62-second runs does your song need? This node tells you โ and says it out loud
- audio
- instructions
- end_time
- total_sets
The VRGameDevGirl music-video workflow doesn't generate a whole song in one shot. It works in sets: fixed 62-second blocks, each made of 16 "groups" of 3.88-second scenes. You generate one set, save it, run again for the next. That scheduling math - how many sets does a 3:41 song need, and what do you do with the ragged final set - is exactly what this node computes, and then it tells you in plain text what to click next.
Feed it an AUDIO clip and a set index, and it returns three things: total_sets (how many 62-second runs the audio needs, including a partial final set), end_time (the track's total length as MM:SS), and - the fun part - instructions, a human-readable string like "This audio requires 4 runs in total. Click 'Run' 2 more times with all 16 groups enabled. Then disable groups 9โ16 so only groups 1โ8 are enabled, and click 'Run' once more."
Why the instructions are text
That's the quirk worth understanding before you use it: this node doesn't queue anything. It reads the audio, does the math, and prints directions for you to follow - run the graph again, toggle which of the 16 group nodes are enabled, run once more for the final partial set. It's "automation" in the sense that a well-designed checklist is automation. The companion node VRGDG_CalculateSetsFromAudio_Queue handles the newer queue-aware flavor; this one is the plain-spoken version that works when your workflow is driven by a human pressing Run.
The logic handles the edge cases the naive version would botch: audio shorter than one set tells you to cancel and disable the unused groups; an exact one-set song tells you you're good to go; a remainder that doesn't even cover one group tells you to skip the extra run.
Inputs and outputs
audio- the full track. Duration is measured from the waveform's sample count and sample rate, so whatever node loads the audio defines the math.index- which set run you're on (0-based), used to produce the right stage of instructions.
Outputs: instructions (STRING), end_time (STRING, MM:SS), total_sets (INT). That's it - no audio out, no state written. It's a calculator that talks back.
Install and gotchas
Same pack: ComfyUI Manager โ search "vrgamedev", or git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl into ComfyUI/custom_nodes, restart, with kornia, librosa, imageio from the README. The set math is baked into the code (62s / 3.88s / 16 groups), so it's tuned to this pack's specific workflow - if you're mixing it into someone else's pipeline, verify the group size matches how your scenes are actually cut. And since the instructions tell you what to click, treat them as a checklist, not a guarantee: disable the wrong groups and the final set comes out with empty slots.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | โ | |
| index | INT | 0 | โ |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| instructions | STRING | โ |
| end_time | STRING | โ |
| total_sets | INT | โ |