Nodes/ComfyUI-FEnodes/Text Split → List
ComfyUI Node

Text Split → List

Turn one string into a list, and stop hand-typing every prompt

By FugitiveExpert01·Created 6 months ago·Updated 10 days ago· 6
Text Split → List
    • text_list
    text
    delimiter,

    Most workflows start the same way: a big blob of text you want to do something to - a comma-separated prompt, a list of seeds, a dump of detected tags. ComfyUI gives you that blob and leaves you to fight with it. TextSplitToList (display name "Text Split", from the comfyui-missed-tool pack) is the missing cutter: split any string on a delimiter, clean it up, and get the pieces as a real list you can feed into batch loops.

    It's the kind of boring-but-essential plumbing you reach for when a workflow needs to process items one at a time - split a tag list, iterate over a batch of prompts, or count how many items a string actually has before you loop.

    What it gives you

    Three outputs, and they're all useful:

    • string_list - the actual list, as a LIST output. This is the one that plugs into any node that takes a list of strings. Every split item, whitespace-trimmed, empties removed.
    • body_text - the original text with the delimiters replaced by whatever you set, as a single clean string. Feed this straight into your positive prompt.
    • item_count - how many items made the cut. Handy for driving loop counts or just sanity-checking your split.

    The inputs that matter

    • delimiter - default ,. What to split on.
    • use_regex - set to enable and the delimiter is treated as a regular expression, so you can split on \n (newlines) or more exotic patterns. Off by default for a reason: a bad regex raises an error that kills the run, so only flip it when you need it.
    • start_index / end_index - slice the list. If your string has 50 items but you only want items 3 through 10, set start_index 3 and end_index 11. Indexes are clamped, so you can't blow past the end.
    • strip_whitespace, skip_empty - both default to on; that's what keeps your list clean. Leave them alone unless you specifically need the raw split.
    • replace_delimiter_with - what body_text swaps the delimiters for. Default is a space.

    The tooltip on that last one is the author's own words: "What to replace the delimiter with in the cleaned text (e.g., space, comma, nothing)." Set it to nothing and you've just stripped all the commas out.

    One honest caveat

    This node splits; it doesn't trim whitespace from your body_text beyond collapsing runs of spaces. And it's from a small pack, so there's no fancy UI - no live preview, no per-item color coding. What you get is dependable list output and a count, which is 90% of what people actually need.

    Install & where to find it

    Same as the rest of the pack - ComfyUI Manager, search comfyui-missed-tool, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ifmylove2011/comfyui-missed-tool.git
    

    Restart, and it's under missed-tool as "Text Split". No dependencies beyond what ComfyUI already ships, no model files.

    CategoryFEnodes

    Inputs (2)

    NameTypeDefaultDescription
    textSTRING
    delimiteroptSTRING,

    Outputs (1)

    NameTypeDescription
    text_listLIST