Nodes/ComfyUI-Muye-nodes/文本列表拆分
ComfyUI Node

文本列表拆分

Turn one blob of text into a proper list of strings

By muyexiuluo·Created about a year ago·Updated 23 days ago· 89
文本列表拆分
    • 输出
    文本

    Somewhere between "paste a wall of text" and "give me a list of strings to iterate over," there's usually a manual step. TextListSplit is that step, automated. You give it a blob of text - multiline, or comma-separated, or semicolon-separated, or even an already-nested list - and it returns a clean STRING list, one item per entry, whitespace trimmed, empties dropped. It's the list-normalizer this pack's text nodes (and ComfyUI's batch-friendly nodes generally) want to consume.

    The splitting rules are simple and in a strict priority order: if the text contains newlines, it splits on newlines; otherwise on commas; otherwise on semicolons; and if it's a single line with none of those, you get a one-element list. So a prompt list pasted one-per-line becomes a list you can loop a batch over, and a comma-separated caption becomes separate items. If the input arrives as a list or tuple - which happens when you chain list outputs - it flattens nested structures and stringifies non-string items, so it's a tolerant end-of-line for mixed upstream data.

    Two things to note. First, it prefers the first delimiter present: if your text has both newlines and commas, only the newlines are used, so a line with cat, dog on it stays one item. If you need to split on a specific delimiter regardless, the pack's TextSplitByDelimiterEnhanced is the more surgical tool. Second, it's marked as an OUTPUT node - it always runs and displays its result, which makes it a handy visible check on what a text chain actually produced. The single output, 输出, is a STRING list.

    The honest framing: this is a small utility, and most of its value is that it exists - it's the bridge between "a human pasted text" and "the graph wants a list," which is a surprisingly common gap. Reach for it when you're hand-feeding a batch of prompts or captions and got tired of building list-shaped input by hand. It's also a fine debugging node for seeing what upstream list nodes are really emitting.

    Install

    ComfyUI Manager → search "muye" → install "ComfyUI-Muye-nodes", restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/muyexiuluo/ComfyUI-Muye-nodes
    cd ComfyUI-Muye-nodes
    pip install -r requirements.txt
    

    then restart. Pure Python - no extra deps. The README's manual block references an older ComfyUI_Muye.git URL; use the -nodes one above. Display name is 文本列表拆分, with the input 文本 and output 输出. If the node's missing, check the console for [Muye] Failed to load module.

    CategoryMuye/文本

    Inputs (1)

    NameTypeDefaultDescription
    文本STRING

    Outputs (1)

    NameTypeDescription
    输出STRING