Nodes/Dream Project Animation Nodes/βŒ› Frame Count Calculator
ComfyUI Node

βŒ› Frame Count Calculator

Do the animation math before you hit go

By alt-key-projectΒ·Created 3 years agoΒ·Updated 2 years agoΒ· 114
βŒ› Frame Count Calculator
    • TOTAL
    β—„hours0β–Ί
    β—„minutes0β–Ί
    β—„seconds10β–Ί
    β—„milliseconds0β–Ί
    β—„frames_per_second30β–Ί

    Before you start a frame-by-frame animation you need to know one number: how many frames am I committing to? At 30fps, a "quick 15 second test" is 450 frames, and at a few seconds per frame that's your afternoon gone. Frame Count Calculator [Dream] exists so you compute that number in the graph instead of on scrap paper.

    It's part of the Dream Project Animation Nodes pack, whose whole design assumes you're animating frame-by-frame, Deforum style - and every node in the pack wants a frame_counter so it knows where in the animation it is. This node is how you size that animation before it starts.

    How it works

    It's one arithmetic formula wearing a friendly face: total_seconds Γ— frames_per_second, rounded to the nearest integer. Total seconds comes from hours Γ— 3600 + minutes Γ— 60 + seconds + milliseconds Γ— 0.001. Nothing clever, nothing hidden - which is exactly what you want from a utility this boring.

    The inputs

    • hours, minutes, seconds - the obvious ones. Defaults are 0, 0, 10.
    • milliseconds - one quirk here: the field maxes out at 59, so it behaves like a "sub-second" counter rather than a real millisecond input. For anything larger than ~59ms, push the extra time into seconds and keep the fraction small.
    • frames_per_second - default 30. Set this to match your actual target framerate, because the whole output is built on it.

    The single output, TOTAL, is an INT.

    Where it wires in

    That TOTAL is meant to become the total-frames number that drives a frame counter. The natural loop: this node β†’ Frame Counter (Simple) [Dream] (or your auto-incrementing counter) β†’ every curve, Image Motion, and saver node that needs the counter. It's also handy as the value behind anything that needs a duration-derived number - a batch size, a seed range, whatever.

    You'll frequently see it used the other way too: someone plans a 10-second clip at 30fps, drops in the node to double-check it says 300, and then hardcodes that into the counter.

    Installing it

    Ships with Dream Project Animation Nodes:

    • ComfyUI Manager - search Dream Project Animation, install, restart.
    • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/alt-key-project/comfyui-dream-project, then pip install -r requirements.txt, restart.

    No model downloads; the pack's requirements (imageio, pilgram, scipy, numpy<2.0, torchvision, evalidate) are lightweight.

    Common issues

    Not much can go wrong with a calculator, but the classic stumble is framerate mismatch: you compute at 30fps, your actual sampler runs at 24, and every timing node downstream is now wrong by 20%. Decide your framerate once, put it everywhere, and let this node be the single source of truth for the frame count. Also remember the output is just an INT - if you change frames_per_second later, everything that consumed TOTAL won't update until the node re-executes.

    Category✨ Dream/πŸŽ₯ animation

    Inputs (5)

    NameTypeDefaultDescription
    hoursINT00–23β€”
    minutesINT00–59β€”
    secondsINT100–59β€”
    millisecondsINT00–59β€”
    frames_per_secondINT30β€”

    Outputs (1)

    NameTypeDescription
    TOTALINTβ€”