Nodes/ComfyUi-MpiNodes/Mpi Text List Join
ComfyUI Node

Mpi Text List Join

Bulk-edit every item of a prompt list in one go

By MadPonyInteractive·Created 11 months ago·Updated 5 days ago· 3
Mpi Text List Join
    • updated_list
    text_list
    join_text
    mode

    Prompt lists are the batch engine of ComfyUI - a list of prompts, sampled one at a time, feeding a generator that churns out variations. The problem is uniformity: every prompt in the list should usually carry the same boilerplate - a quality prefix, a style suffix, a shared negative tag - and retyping that onto each entry is exactly the kind of tedious, error-prone edit that rots a workflow. MpiTextListJoin is the bulk edit: prepend or append one string to every item in a text list in a single pass.

    It's the plumbing behind the pack's prompt-list ecosystem. Upstream you've got MpiPromptList or a wildcard-style list; downstream is a sampler or a prompt processor. Drop this in between, and "masterpiece, best quality," (or whatever your style demands) lands on the front of all five hundred entries without touching the list itself. The list stays your data; the join stays your edit, and you can change the boilerplate in one widget instead of regenerating everything.

    The inputs that matter

    • text_list - the list of strings. This is a list socket, not a single string: the node sets INPUT_IS_LIST, so wire it from something that emits a list (a prompt list node, not a single MpiString).
    • join_text - the string to add, single-line.
    • mode - prepend or append. Prepend puts join_text at the front, append at the back.

    Output: updated_list, typed as a list of STRINGs (the node declares OUTPUT_IS_LIST), ready to feed whatever consumed the original.

    Install

    Part of ComfyUi-MpiNodes. ComfyUI Manager (search "MpiNodes" / publisher "mad-pony-interactive"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes
    

    Restart. No extra dependencies - this is a list comprehension in a trench coat.

    Where people trip

    The list-socket detail is the one that bites. If you wire a single MpiString into text_list, the node reads it as a one-item list and you get one item back - no error, just a silent no-op for what you meant. List consumers need list producers. And because join_text is applied verbatim to every item, remember to include your own spaces and commas: prepend with join_text = "masterpiece" gives masterpiece... glued to the front with no separator. The output is a list, so pipe it into a node that indexes or samples the list - that's what it's for. If you need to change text inside items rather than add to the edges, that's MpiTextListReplace's job; this one only tacks text on.

    CategoryMpiNodes/TextOps

    Inputs (3)

    NameTypeDefaultDescription
    text_listSTRING
    join_textSTRING
    modeCOMBO2 options: prepend, append

    Outputs (1)

    NameTypeDescription
    updated_listSTRING