ComfyUI Node

VRGDG_DurationIndexFloat

Grab one duration out of the list

By vrgamegirl19·Created about a year ago·Updated about 7 hours ago· 718
VRGDG_DurationIndexFloat
    • duration
    • num_scenes
    durations_text
    index0

    If you're building a music video in ComfyUI, scene timing is the thing you can't fake. Every scene needs a length - how many seconds of video to generate, how long the shot runs - and it needs to line up with the song. VRGDG_DurationIndexFloat is the pack's way of turning a list of scene durations into a single number you can feed a video sampler: give it the timing list and a scene index, and it hands back the duration for that scene, plus the total scene count for bookkeeping.

    How it works. You paste your durations into durations_text - one per scene, in the same order the scenes will run - and provide an index. The node looks up the duration at that index and outputs it as a FLOAT, which is exactly the type a frame-count or step-count calculation wants. It also returns num_scenes, the total number of durations you entered. If you're driving a per-scene loop, you can use num_scenes as your loop ceiling and duration as the per-iteration value; the two outputs are designed to work together.

    That's really all it does - it's a lookup, not a calculator. It doesn't sum the durations, doesn't convert to frames. If you need frames, multiply the FLOAT by your fps in a math node on the way to the sampler.

    Why it's categorized under audio. In the music video pipeline this node feeds off the audio-driven scene analysis. The workflow analyzes the song, splits it into scenes, and writes out the timing list; this node then serves those timings to the video generation side one scene at a time. It's the bridge between "here's what the song dictates" and "here's how long to render."

    The inputs. Only two, both simple:

    • durations_text - your list of scene durations (the format follows the same list conventions as the rest of the pack: one per line, commas, etc.)
    • index - which scene's duration you want.

    The outputs. duration (FLOAT) for the sampler math, and num_scenes (INT) when you need to know how many scenes exist.

    Installing. It ships in the VRGameDevGirl pack:

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

    or find vrgamedev in ComfyUI Manager, then restart.

    Where people trip: the usual index-vs-order mistake. If your index starts at 0 and your scene numbering starts at 1, everything's off by one - and since a wrong duration mostly means a slightly-too-short or too-long scene, it can take a while to notice. Also, keep the order in durations_text identical to the order your scenes actually run, or the timings silently attach to the wrong shots. Check num_scenes once when you wire it up; if it doesn't match your scene list, the mismatch is upstream, not here.

    Categoryaudio

    Inputs (2)

    NameTypeDefaultDescription
    durations_textSTRING
    indexINT0

    Outputs (2)

    NameTypeDescription
    durationFLOAT
    num_scenesINT