Nodes/ComfyUI-ListHelper/PromptListGenerator
ComfyUI Node

PromptListGenerator

One big text box, a hundred prompts

By dseditor·Created about a year ago·Updated 7 months ago· 75
PromptListGenerator
    • text_list
    • total_index
    text
    delimiter
    use_regexfalse
    keep_delimiterfalse
    start_index0
    skip_every0
    max_count10
    skip_first_indexfalse
    random_orderfalse
    seed0

    PromptListGenerator does exactly one thing and does it well: it takes a big blob of text, splits it into a list of strings, and hands you that list. Paste a hundred prompts into one multiline box, get a list out, and batch through them. That's the whole pitch, and honestly it's a node a lot of batch-heavy workflows are missing.

    One naming note up front: the README calls this family of nodes PromptSplitByDelimiter, but the shipped code registers PromptListGenerator. Same logic, code-name wins. If you're hunting through the pack for it, search "ListHelper/Tools" in the node menu.

    How it works

    The defaults make it friendly. If you leave delimiter empty, it splits on newlines, so a simple "one prompt per line" text box Just Works. Under the hood it normalizes runs of blank lines, trims whitespace, and drops empty segments. Turn on use_regex and the delimiter becomes a Python regex pattern - handy for things like splitting on 第\d+章 chapter markers or a (章|節|段) choice group. keep_delimiter keeps the delimiter attached to the following segment, which matters when the delimiter carries meaning (like // separators in a script).

    The three inputs that do the interesting work:

    • random_order + seed - shuffles the list with a seeded RNG, so you get reproducible "pick a random prompt from my pool" behavior instead of always running the same order.
    • start_index + max_count - slice a window out of the list rather than taking everything.
    • skip_every - take every Nth item, useful for sampling a subset of a big list.

    It returns two outputs: text_list (the split strings) and total_index (the total count before slicing - so if you take 2 of 20, total_index is 20). That count is nice for driving a loop.

    Where it slots in

    List output is the currency of batch workflows. Wire text_list into anything that consumes a STRING list - a prompt-list loop, or this pack's own number/list nodes if you want paired parameter sweeps. It's also the natural front-end for the LLM-assisted-prompting pattern the community converged on: generate a pile of candidate prompts, then rotate through them per batch instead of hand-writing each one.

    Gotchas

    The big one: an invalid regex silently falls back to plain string splitting. That's arguably a feature - a broken pattern won't crash your workflow - but it means you can miss that your fancy pattern never ran. Watch the console, which logs nothing useful about the fallback.

    For reproducible runs, random_order with a fixed seed is deterministic. Without a seed you get a different shuffle each time.

    Install

    Same pack as the whole collection:

    cd ComfyUI/custom_nodes
    git clone https://github.com/dseditor/ComfyUI-ListHelper
    

    Restart ComfyUI, or install "ComfyUI-ListHelper" via ComfyUI Manager. No extra dependencies for this node - it's pure Python re and random. That's the appeal: it's a boring, dependency-free utility you can trust not to break your install.

    CategoryListHelper/Tools

    Inputs (10)

    NameTypeDefaultDescription
    textSTRING
    delimiterSTRING
    use_regexBOOLEANfalse
    keep_delimiterBOOLEANfalse
    start_indexINT00–1000
    skip_everyINT00–10
    max_countINT101–1000
    skip_first_indexBOOLEANfalse
    random_orderBOOLEANfalse
    seedINT00–2147483647

    Outputs (2)

    NameTypeDescription
    text_listSTRING
    total_indexINT