Nodes/comfyui-prompt-sequence/Prompt Sequence Text
ComfyUI Node

Prompt Sequence Text

One queue, five prompts — the node the pack is named after

By Localsmile·Created 3 months ago·Updated 3 months ago· 0
Prompt Sequence Text
    • text
    prompts
    modesequential
    seed-1
    max_items0

    This is the node the whole pack is built around, and it's barely more than a multiline text box. Paste in several prompts, one per line, and it turns them into a list - feed that into a CLIP Text Encode and one queue run renders all of them. That's the entire trick, and it's the thing the rest of the pack exists to feed. Want the same character in four different moods without re-queueing four times? This is your starter node.

    If you've come from A1111, this is roughly the batch mode you always wanted but in node form - the sequence outputs a STRING list, CLIP Text Encode encodes each item in turn, and your KSampler churns through the whole batch. It pairs naturally with the pack's other nodes: wire several of these into Prompt Sequence Join to combine two sequences into one batch, or drop a Prompt Tag Formatter in front to clean up pasted tags first.

    How it works

    The mechanism is deliberately boring, which is the point. Each non-empty line in the box becomes one item; blank lines are dropped, and whitespace is trimmed so " red jacket " and "red jacket" are the same prompt. What you can do with it:

    • mode - sequential outputs top to bottom (the default), random shuffles first.
    • seed - only matters in random mode. -1 (default) rolls a new order every queue; any fixed number replays the same order, which is how you keep a shuffled batch reproducible.
    • max_items - 0 outputs everything; a positive value caps the list, so a 20-line box can emit just the first five.

    The one non-obvious bit is underneath: when mode is random and seed is -1, the node returns float("NaN") from its IS_CHANGED hook - the ComfyUI idiom that marks a node as always-dirty, forcing it to re-run and reshuffle each time instead of serving the cached result. That's exactly what you want here, and it's the same trick used by random pickers across the ecosystem. Give it a fixed seed and it goes back to normal caching, so it only re-runs when the input actually changes.

    The one output

    text - a STRING list, wired into CLIP Text Encode's text input. That's the whole integration story: the list fans out into a batch, and the sampler handles the rest.

    Install

    ComfyUI Manager → install, search comfyui-prompt-sequence; or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Localsmile/comfyui-prompt-sequence
    

    Restart after either. No pip dependencies and no model files - it's pure stdlib plus the ComfyUI runtime, so there's nothing to break.

    What usually trips people

    Two things. First, blank lines: the README's "each non-empty line becomes one prompt item" means an accidental blank line between prompts silently joins those two into one prompt instead of separating them - if your batch comes out short, check for stray empty lines. Second, this is a small pack with zero community footprint and a single-commit repo, so treat the first run as a test. It does one thing and does it simply - but the "sequence" idea here is text-only. For prompt cards with reference images, the pack has separate nodes for that.

    Categoryprompt sequence

    Inputs (4)

    NameTypeDefaultDescription
    promptsSTRINGEach non-empty line becomes one prompt item.
    modeCOMBOsequentialsequential: output top to bottom. random: shuffle before output.
    seedINT-1-1–9223372036854776000For random mode: -1 makes a new order each queue; a fixed value repeats the same order.
    max_itemsINT00–100000 outputs all available prompts. A positive value outputs up to that many prompts.

    Outputs (1)

    NameTypeDescription
    textSTRING