Nodes/On-Set Studio/On-Set Studio -- Scene Data
ComfyUI Node

On-Set Studio -- Scene Data

The node that tells your video graph how long the shot is

By IsItDanOrAi·Created 2 months ago·Updated 21 days ago· 2
On-Set Studio -- Scene Data
    • fps
    • frame_count
    • duration
    • in_frame
    • out_frame
    • still_frame
    • width
    • height
    • aspect
    • technical_json
    ◄sessiondefault►

    The short version

    Your video graph needs three numbers it can never guess: how many frames, at what rate, and what shape. You can type them. You will type them wrong, because the shot changed after you typed them.

    On-Set Studio -- Scene Data reads the same payload the editor sent to ComfyUI and hands you those numbers as typed sockets. Add it, wire frame_count into your latent video node's length, wire fps where a rate is expected, and stop keeping two copies of the truth.

    It's a deliberately separate node from the main On-Set Studio node, which might look like clutter until you notice what it avoids: the flagship carries pictures and prose, this one carries numbers, and most graphs want one or the other. There's also no key widget - no field: value text box where a typo silently becomes an empty string. Every value gets its own socket, so it's self-documenting and nothing is mistyped.

    What it reads, and the two rules that matter

    One input: session, defaulting to default - the same label the flagship node uses. Both nodes read the payload the editor writes when you press Send to ComfyUI, and both resolve still-versus-sequence the same way: whichever send is newer wins. They'll never disagree about which shot they're describing.

    Then two rules that explain most of its behaviour.

    The numbers describe the delivered clip, not the timeline. If you sent a single frame, this is honestly a one-frame clip: frame_count 1, and in_frame == out_frame == still_frame at the playhead. Make peace with that. It's why frame_count is safe to wire straight into an empty-latent video node.

    The disk is the truth. frame_count is written when the editor starts rendering a sequence and describes what it intended to send. If you hit stop, or the browser tab dies, there are fewer PNGs on disk than that. This node counts the actual files and corrects frame_count, out_frame and duration to match, printing what it did - which matters because the alternative is sizing a latent for frames that don't exist. Its sibling node does the same correction, so the two stay consistent.

    Outputs

    Ten of them, all typed:

    • fps (FLOAT) - deliberately a float, not an int. 23.976 and 29.97 are real broadcast rates, and an integer socket would round them to 24 and 30 - a quarter frame of drift every second, which is a visibly wrong clip length over a minute.
    • frame_count (INT), duration (FLOAT).
    • in_frame, out_frame, still_frame (INT) - the rendered range, and the playhead frame for a still.
    • width, height (INT), aspect (STRING, computed from the pair when the editor didn't send one).
    • technical_json (STRING) - the full technical document, if you want the rest.

    frame_count and fps are the two you'll actually wire. The rest are for graph-side sanity checks: file naming, a text overlay, or a branch that behaves differently on a 1-frame send.

    Installing it

    Same pack, same install - nothing extra. If you're installing by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/IsItDanOrAi/ComfyUI-On-Set-Studio
    

    Restart ComfyUI. The pack ships three nodes under the On-Set Studio category and every display name starts with "On-Set Studio", so one search in the Add Node menu finds the whole set. No Python dependencies, no compile step. See the main On-Set Studio article for the character model and first-run details, which are shared across all three.

    Getting burned by it

    "no payload for session 'default'." Same as the flagship node: nothing has been sent yet. Build a scene in the editor, press Send, then Run.

    Zeros everywhere. fps comes back 0 if the payload carries no rate - for instance a payload from an editor older than v222, in which case the node prints a note and falls back to whatever fields it can find, rather than dying. Re-send to get exact values.

    You changed the shot and the numbers didn't move. They do move, but only after a new send - the node reports both payload mtimes to ComfyUI so it re-executes on a fresh send instead of serving a cached result. Press Send, then Run.

    The clip is still the wrong length after wiring frame_count. Check the slot's Frame/Video toggle in the editor's Settings tab. A slot set to Frame sends one image no matter how long the timeline is, and this node will faithfully tell you the truth about it - the number is correct, the send wasn't what you thought. This node reports what the editor delivered; it can't fix the delivery.

    It's a small, unglamorous node that removes a whole class of silent mismatch. Which is the best thing a plumbing node can be.

    CategoryOn-Set Studio

    Inputs (1)

    NameTypeDefaultDescription
    sessionSTRINGdefault—

    Outputs (10)

    NameTypeDescription
    fpsFLOAT—
    frame_countINT—
    durationFLOAT—
    in_frameINT—
    out_frameINT—
    still_frameINT—
    widthINT—
    heightINT—
    aspectSTRING—
    technical_jsonSTRING—