ComfyUI Node

QOL Split String

Unpack a tag list into separate wires

By omar92·Created 3 years ago·Updated 5 months ago· 181
QOL Split String
    • string_1
    • string_2
    • string_3
    • string_4
    • string_5
    • string_6
    • string_7
    • string_8
    • string_9
    • string_10
    • string_11
    • string_12
    • string_13
    texttext
    delimiter,

    You've got a comma-separated prompt string - from a ChatGPT prompt-generator node, a file, a saved workflow - and you want to do something to part of it: route the style tags to one encoder, the subject to another, or just pull out the third tag without string surgery. QOL Split String is the tool: it chops text on a delimiter and hands you up to 13 individual string outputs, each one its own wire.

    It's the inverse of Concat Text _O, and the pair is the whole story of the pack's O/text/operations group: one glues prompt pieces together, the other pulls them apart. This node lives in the Quality of Life Suit under O/text/operations.

    How it works

    Mechanically it's text.split(delimiter) followed by a strip() on each piece, truncated to the first 13 parts. The outputs are named string_1 through string_13 in order, and any slots past the end of your split come out as empty strings - so "a,b,c" yields string_1="a", string_2="b", string_3="c", and string_4 onward are "". That padding means you can wire downstream nodes once and they never break on short input.

    The inputs that matter

    • text - required, the string to split.
    • delimiter - optional, default ,. This is the one to watch. If you leave it at the comma you're splitting on every comma, which is the standard SD tag-list shape. But note it's a literal substring, not a regex: use ", " if your list has spaces after commas and you want them stripped for free.

    Outputs: string_1string_13, all STRING.

    Installing

    Pack-wide install - ComfyUI Manager, search ComfyUI-QualityOfLifeSuit_Omar92, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/omar92/ComfyUI-QualityOfLifeSuit_Omar92.git
    

    Restart ComfyUI after cloning (refresh alone won't do it). The pack needs no base dependencies for this node.

    Where it bites

    Two things. First, only the first 13 pieces survive - a 20-tag prompt silently drops the tail, and there's no warning. If you're splitting a long ChatGPT tag dump, count your tags first. Second, the split is naive: there's no handling for delimiters inside quoted groups, so a description-style string with commas in sentences will shatter into nonsense. Use it on clean, separator-delimited tag lists and it's rock solid; use it on free prose and you'll be confused by the output.

    CategoryO/text/operations

    Inputs (2)

    NameTypeDefaultDescription
    textSTRINGtext
    delimiteroptSTRING,

    Outputs (13)

    NameTypeDescription
    string_1STRING
    string_2STRING
    string_3STRING
    string_4STRING
    string_5STRING
    string_6STRING
    string_7STRING
    string_8STRING
    string_9STRING
    string_10STRING
    string_11STRING
    string_12STRING
    string_13STRING