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

String Sequence πŸ•’πŸ…‘πŸ…£πŸ…

String Sequence for timed real-time scenes

By ryanontheinsideΒ·Created 2 years agoΒ·Updated about a year agoΒ· 82
String Sequence πŸ•’πŸ…‘πŸ…£πŸ…
    • STRING
    β—„always_executetrueβ–Ί
    β—„steps_per_item30β–Ί
    β—„sequence_modeforwardβ–Ί
    β—„valuesfirst second thirdβ–Ί

    If String Control is the smooth jazz of real-time text animation, String Sequence πŸ•’πŸ…‘πŸ…£πŸ… is the metronome. Instead of sweeping a pattern through a list, it holds one string for an exact number of executions, then snaps to the next. It's the difference between a prompt that morphs and a prompt that switches scenes on cue - and for timed shows, title cards, or state-machine-style live workflows, you want the latter.

    Same pack, same author: ryanontheinside/ComfyUI_RealtimeNodes, a node suite built to run once per frame under ComfyStream-style runners. String Sequence is the deterministic sibling of String Control, and it lives a few nodes over in the same "Sequence Controls" family as FloatSequence and IntSequence.

    How it works

    It's a tiny state machine with two counters. Each execution increments step_counter; when the counter hits steps_per_item, it advances to the next index in your list and resets. The sequence_mode decides how "next" is chosen:

    • forward - walk the list top to bottom, then loop.
    • reverse - bottom to top, looping.
    • pingpong - bounce at both ends, so the last item isn't a hard cut back to the first. Nicer for looping two-state content.
    • random - jump anywhere each time.

    Because it's counter-based rather than pattern-based, the timing is exact: every item gets the same number of executions, no easing, no drift. That predictability is the whole selling point - you can compute that on a 24 fps stream, 60 frames per item is 2.5 seconds of each prompt, forever.

    The inputs that matter

    • values - one string per line, your content. Defaults to first / second / third.
    • steps_per_item (default 30) - executions per string. This is your dwell time; crank it for slow storytelling, drop it to 5 for rapid flicker.
    • sequence_mode - forward / reverse / pingpong / random, per above.
    • always_execute (default on) - same deal as every control node in this pack: this is what lets the counter tick on every execution. Leave it on.

    Output: a single STRING. Wire it into CLIP Text Encode for timed prompt changes, or feed it to any text input you want to see on a schedule.

    Installing it

    Identical to the rest of the pack. ComfyUI Manager: search "Control Nodes" or "Realtime" and install. Or manually:

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

    Restart ComfyUI and you'll find String Sequence under Realtime Nodes β†’ control/sequence. One gotcha to know before you start: the repo is ComfyUI_RealtimeNodes (lowercase "t" in "Realtime") - the README's own example flubs the case, and GitHub will 404 you if you copy it wrong. The requirements pull mediapipe along with everything else, but this node doesn't use it; it's just how the pack ships.

    Where people get burned

    First: the counter counts executions, not wall-clock seconds. On a normal one-shot ComfyUI run the node fires exactly once and the sequence never advances - you have to be running the workflow continuously (ComfyStream, a webcam loop, a driver that re-queues) for the timing to mean anything. That's by design, but it's the #1 "why is nothing happening" post with these nodes.

    Second: steps_per_item too low with a long list produces a strobe. Each item still gets its full count of frames, but if you're showing ten items at 3 frames each on a 30 fps feed, that's a full list cycle every second - either intentional or nauseating, your call. And there's no preview clock anywhere in the UI, so if you need frame-exact sync with audio or external triggers, budget a little experimentation time. It's a simple, honest node - it does exactly one thing (hold-and-snap), which is why it's the one I reach for when the prompt must change on a schedule and not a whim.

    Categoryreal-time/control/sequence

    Inputs (4)

    NameTypeDefaultDescription
    always_executeBOOLEANtrueWhen enabled, the node updates every execution
    steps_per_itemINT301–1000Number of frames to show each item
    sequence_modeCOMBOforwardHow to move through the sequence
    valuesSTRINGfirst second thirdList of strings (one per line)

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGβ€”