FB Multiline String List
One prompt per line, out comes a batch-ready list
- prepend
- STRING_LIST
You've got ten prompt variants, or a block of LoRA trigger words, or a list of filenames - and some node downstream wants a STRING_LIST, not a wall of text. FB Multiline String List is the bridge: you paste your lines into a big box, and it hands you a clean Python list, one item per line.
If you've ever done prompt batching or variation runs, you already know how much fiddly work this replaces. Instead of hand-building a list node, you write the lines like a normal human and let this node do the splitting.
How it works
The mechanism is dead simple: split the value on newlines, then strip whitespace off every line. The .strip() is the part people don't expect and immediately appreciate - no trailing spaces sneaking into your prompts, no invisible \n junk in items.
Two switches change the behavior:
- enabled (default on) - when off, the node returns an empty list. This is a hard kill switch, not a filter.
- prepend (optional) - a
STRING_LISTthat gets joined onto the front of whatever you typed. Handy for guaranteeing a base set of items that always runs, even when the text box is empty or disabled.
Inputs and outputs
- value - multiline text, one item per line.
- enabled - boolean, gates the whole output.
- prepend - optional
STRING_LISTadded to the front. - STRING_LIST - the output; wire it into any node that consumes a string list.
Where it fits
The classic use is prompt variation: feed the list into a batch or loop node that iterates each line as a separate generation, so one run walks through all your variations. The KB's prompt-engineering write-up covers the wildcard approach to the same problem; this is the explicit-list version, and it's easier to read when the variants are genuinely different prompts rather than token swaps.
It also pairs with the rest of the pack: FB String Join takes the list back to a single comma-joined string, and FB String Split does the inverse for delimited input. Trigger-word lists for LoRA stacks are another natural target - keep the words in a readable block, feed the list where it's needed.
Gotchas
- Blank lines become empty strings. The strip happens per line, but an empty line isn't dropped - a stray blank line at the end of your block produces an empty string item that can silently do nothing (or worse) downstream. Watch the end of your text.
- enabled off returns
[], not "nothing". If something downstream iterates the list and expects at least one item, an empty list can produce zero outputs without an error. That's whatprependis for - it keeps your defaults flowing even when the box is off. - The list order is exactly your line order, top to bottom, with prepend items in front.
Install
This node ships in the comfyui-fb-utils pack, so installing the pack gets you all seven. No dependencies, no models:
cd ComfyUI/custom_nodes
git clone https://github.com/FredBill1/comfyui-fb-utils
Restart ComfyUI and look under the FredBill1 category (or install via ComfyUI Manager, searching comfyui-fb-utils). The entire pack is Python standard library - no requirements.txt, no pip step, nothing that can clash with your other nodes. The README is a single line; the code is short and readable if you want to verify what I just told you.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| value | STRING | — | |
| enabled | BOOLEAN | true | — |
| prependopt | STRING_LIST | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING_LIST | STRING_LIST | — |