Nodes/ComfyUI 1hewNodes/List Custom String
ComfyUI Node

List Custom String

Turn one text box into a real list that batch loops can eat

By 1hew·Created about a year ago·Updated 7 days ago· 33
List Custom String
    • string_list
    • count
    custom_text

    ComfyUI has a persistent annoyance: a lot of nodes want a list of strings, but the simplest way to type things is a plain text box. List Custom String (1hew_ListCustomString) is the bridge - you paste a block of text, it comes out the other side as a proper STRING list plus a count, ready to feed whatever iterates over items.

    It's a small node, and it's one of the ones you start taking for granted once you've built a few batch workflows. Paste in ten prompt variants, wire the list into a loop or a list-consuming node, and you're done.

    How it works

    The whole job is splitting text sensibly. The splitter is smarter than "split on newline," and this is the part worth knowing:

    • A line made of only dashes (---) is treated as a hard block separator - that's the feature that makes it useful. You can group multi-line chunks into single list items.
    • Otherwise it splits on newlines.
    • If there are no newlines, it falls through to /. separators, then /;, then /,.

    It also strips surrounding quotes from each item, so "hello" becomes hello. Empty input doesn't crash it - you get a one-item list containing "default", which is the pack's way of keeping downstream nodes from exploding on an empty list.

    Inputs and outputs

    • custom_text - the multiline input. That's the only input.
    • string_list - the STRING list output.
    • count - an INT of how many items you got.

    count is easy to overlook and genuinely handy: wire it into a Compare node or a loop counter instead of hardcoding a batch size. The node even shows the count in the UI (via the pack's text helper) so you can sanity-check your separators before it feeds anything.

    Installing it

    It's part of the 1hewNodes pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/1hew/ComfyUI-1hewNodes
    

    or search "1hewNodes" in ComfyUI Manager, then restart. No model downloads, no extra deps beyond what the pack's requirements pull in (it's a light one).

    Where it fits

    This is one of those text-list builders that pairs with the pack's other list nodes - List Custom Int, List Custom Float, List Custom Seed - to drive batch iteration. The seed-list sibling is worth a look if you're doing variation runs: generate a unique list of seeds, feed them into a loop, and every iteration gets a different seed without touching the graph.

    One thing to know: this is a "list of strings" node. If you hand it comma-separated values and expect count to be huge, remember the fallback order - commas are the last resort splitter, only used when there are no newlines, periods, or semicolons. When in doubt, use newlines or the --- separator; they're unambiguous and what the pack's own examples assume.

    Category1hewNodes/text

    Inputs (1)

    NameTypeDefaultDescription
    custom_textSTRING

    Outputs (2)

    NameTypeDescription
    string_listSTRING
    countINT