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

Prompt Sequence Join

Zip prompt lists together — it's a zip, not a cartesian product

By Localsmile·Created 3 months ago·Updated 3 months ago· 0
Prompt Sequence Join
    • text
    input_count2
    separator,
    skip_emptytrue
    length_policylongest
    missing_policyblank
    max_items0
    text_1
    text_2
    text_3
    text_4
    text_5
    text_6
    text_7
    text_8
    text_9
    text_10
    text_11
    text_12
    text_13
    text_14
    text_15
    text_16
    text_17
    text_18
    text_19
    text_20
    text_21
    text_22
    text_23
    text_24
    text_25
    text_26
    text_27
    text_28
    text_29
    text_30
    text_31
    text_32

    Prompt Sequence Join is the node that makes the rest of the pack worth installing. It takes two or more prompt sequences and merges them into one combined list - so you can run "four expressions × two outfits" as a single queued batch instead of hand-writing all eight prompts. That's the headline use case, and the README's minimal graph is basically this node: two Text nodes in, one text list out, straight into CLIP Text Encode.

    But manage your expectations on the math. This is a zip, not a cartesian product. It pairs the first prompt of A with the first of B, the second with the second, and so on - it does not generate every combination. A 4-item list and a 2-item list give you 4 joined results (with the shorter list padded), not 8. If you genuinely want every cross product, this isn't that node.

    How it works

    Start with two text inputs; bump input_count and click update inputs to reveal more - up to 32 sockets, all fed by text_1 through text_32. Then decide how uneven lists behave:

    • separator - the glue between parts, default ", ". It understands escapes: \n or /n become a newline, so ,\n gives you a comma-newline join for multi-line prompts.
    • length_policy - longest (default) emits until the longest input is exhausted; shortest stops at the shortest connected input.
    • missing_policy - what happens when a shorter input runs dry: blank (default) leaves the spot empty, repeat_last reuses that input's final value.
    • skip_empty - when on (default), blank parts are dropped along with their separator, so you don't get ", , " gaps.
    • max_items - caps the final joined count.

    The README's example shows the default policy clearly. A is a1, a2, a3, a4, B is b1, b2. Output: a1, b1 / a2, b2 / a3 / a4. Switch missing_policy to repeat_last and it becomes a3, b2 / a4, b2 - B's last value carries the tail. That's the setting you want when a constant background or style should repeat across a longer subject list.

    Output

    text - one STRING list, the joined batch, wired into CLIP Text Encode like any other sequence output.

    Install

    ComfyUI Manager, search comfyui-prompt-sequence, or:

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

    Restart after either. No extra dependencies or model files.

    The failure modes

    The classic stumble is changing input_count and expecting the sockets to appear - they don't until you hit update inputs. Forgetting that is the top "why is it still showing two inputs" report. The second one is expecting cartesian behavior; when your batch comes out shorter than the number of combinations you imagined, re-read the zip explanation above. And the separator escapes only translate \n//n/\t - type the literal characters into the field, not an actual newline, or you'll get it right in the UI and wrong in the export.

    Categoryprompt sequence

    Inputs (38)

    NameTypeDefaultDescription
    input_countINT21–32Number of visible text inputs. Click update inputs after changing it.
    separatorSTRING, Text inserted between parts. Use \n or /n for a newline, including ,\n or ,/n.
    skip_emptyBOOLEANtrueWhen enabled, blank missing parts are removed before joining, including their separator.
    length_policyCOMBOlongestlongest: emit up to the longest input. shortest: stop at the shortest connected input.
    missing_policyCOMBOblankblank: missing values become empty text. repeat_last: reuse the shorter input's final value.
    max_itemsINT00–100000 keeps all joined prompts. A positive value limits the final joined output count.
    text_1optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_2optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_3optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_4optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_5optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_6optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_7optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_8optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_9optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_10optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_11optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_12optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_13optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_14optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_15optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_16optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_17optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_18optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_19optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_20optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_21optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_22optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_23optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_24optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_25optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_26optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_27optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_28optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_29optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_30optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_31optSTRINGConnect a prompt sequence. Missing values follow missing_policy.
    text_32optSTRINGConnect a prompt sequence. Missing values follow missing_policy.

    Outputs (1)

    NameTypeDescription
    textSTRING