Nodes/Nodes for use with real-time applications of ComfyUI/State Test Node πŸ•’πŸ…‘πŸ…£πŸ…
ComfyUI Node

State Test Node πŸ•’πŸ…‘πŸ…£πŸ…

The Simplest Way to Verify State Persists

By ryanontheinsideΒ·Created 2 years agoΒ·Updated about a year agoΒ· 82
State Test Node πŸ•’πŸ…‘πŸ…£πŸ…
    • INT
    β—„always_executetrueβ–Ί
    β—„increment1β–Ί

    State Test Node is a counter that increments every time it executes and outputs the running total as an INT. That's all it does. And honestly, that's what makes it useful - it's the fastest way to answer the single most confusing question in real-time ComfyUI: is my node actually re-running every frame, and does its state persist between runs?

    Because the pack's stateful nodes (Float Control, the sequences, the motion controllers) all depend on two assumptions - that they execute on every frame and that their state survives - you'll eventually want proof those assumptions hold in your setup. Wire State Test Node in, let it run for a few seconds, and read the counter. If it's climbing, your loop is executing continuously and state is persisting. If it's stuck at 1, your workflow is being cached, always_execute is doing nothing, or the frontend isn't looping the way you think. It's a diagnostic dressed up as a counter.

    Mechanically it keeps one number in the pack's shared state manager: state["counter"] += increment on every execution. The increment input (default 1, up to 100) lets you scale it - crank it to 100 and it becomes a coarse "frames Γ— 100" odometer, or use it as a cheap frame counter that reaches big numbers fast. State persists between executions by design, so the count keeps rising until a state reset (or this pack's State Reset Node) wipes it.

    The inputs

    • increment - how much to add per execution (default 1).
    • always_execute - on by default; the counter only counts if the node actually runs, so this is the knob that makes the diagnostic meaningful.

    Output: INT - the running count.

    Install & the honest pitch

    Part of ryanontheinside/ComfyUI_RealtimeNodes - ComfyUI Manager (search "Control Nodes") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ryanontheinside/ComfyUI_RealtimeNodes
    cd ComfyUI_RealtimeNodes
    pip install -r requirements.txt
    

    Reach for it when your animated values aren't animating. That's the moment most people burn an hour - is it the control node, the caching, or the frontend? One counter settles it in ten seconds. It's marked (BETA) like its sibling, but a counter is a counter. The only thing it won't tell you is why state got cleared; for that, pair it with State Reset Node and the rest of the control toolkit. As a utility it's not going to make your renders prettier, but it will stop you from chasing ghosts.

    Categoryreal-time/control/utility

    Inputs (2)

    NameTypeDefaultDescription
    always_executeBOOLEANtrueWhen enabled, the node updates every execution
    incrementINT11–100Amount to increment counter by

    Outputs (1)

    NameTypeDescription
    INTINTβ€”