ComfyUI Node

Prompt Queue

Generate a whole batch of scenes without touching ComfyUI again

By Merserk·Created 9 months ago·Updated about a month ago· 6
Prompt Queue
    • text
    prompts
    on_endempty
    strip_linestrue
    skip_empty_linestrue
    reset_trigger0

    Prompt Queue is the node that turns one text box into a whole batch job. Paste a multi-line list of prompts, connect its text output into your conditioning, set ComfyUI's batch count to match, and each queue run feeds the next line down the graph. You walk away; the node babysits the list. It's the "Storyteller" pattern the Flow Assistor README pushes, and for anyone who generates multi-scene comics, slideshows, or variant tests it's the most useful node in the pack.

    How it works

    This is a stateful node, which is rarer than it should be in ComfyUI. On every execution it hands back the current line, then advances an internal pointer. The pointer lives in a per-node state store keyed by the node's unique ID, not on the node object, because ComfyUI's V3 API doesn't keep node instances alive between runs. Two details matter if you're debugging:

    • The whole list is the config. If you change the prompts text, the node re-parses and starts over from line 1. You don't need to hunt for a reset button.
    • reset_trigger forces a restart. Bump it (any integer change works) and the pointer jumps back to the start mid-run.

    The only input you really touch is prompts - a multiline text field. The other three are genuinely optional:

    • on_end - what happens when you run out of lines: empty (outputs a blank string and stays at the end), repeat_last (keeps emitting the last line), or loop (wraps back to the top). loop is your friend for endless K-Sampler iteration testing; repeat_last is handy when batch count slightly overshoots the list.
    • strip_lines and skip_empty_lines - both default to true, and you basically never turn them off. They kill stray whitespace and blank lines so your queue doesn't cough up an empty prompt halfway through.

    Output is a single text (STRING). Wire it into a CLIP Text Encode in place of your normal prompt box.

    Installing

    This ships in the ComfyUI-Flow-Assistor pack - install via ComfyUI Manager (search "Flow Assistor"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Merserk/ComfyUI-Flow-Assistor.git
    

    Then restart ComfyUI. Two version gotchas: the pack is V3-only (it needs a current ComfyUI build with the comfy_api.latest node API - an old ComfyUI simply won't load it), and it has zero extra Python dependencies beyond what ComfyUI already ships. If it doesn't appear after install, update ComfyUI first, not the pack.

    Where people get burned

    The classic mistake is expecting Prompt Queue to be stateless. Because it advances on every execution, running the graph once to test a single prompt will silently skip you ahead in the list. If you're debugging one line, connect the line to a plain text node or reset the trigger before you run. Also remember it's per-node: duplicate the node and it starts its own independent queue, which is exactly what you want for positive/negative pairs.

    For the "why" behind ComfyUI's endless small nodes and the dependency friction around them, the ecosystem essay in the knowledge base sets the context; this pack at least sidesteps the dependency part entirely.

    Categoryflow-assistor/text

    Inputs (5)

    NameTypeDefaultDescription
    promptsSTRING
    on_endoptCOMBOempty3 options: empty, repeat_last, loop
    strip_linesoptBOOLEANtrue
    skip_empty_linesoptBOOLEANtrue
    reset_triggeroptINT00–2147483647

    Outputs (1)

    NameTypeDescription
    textSTRING