ComfyUI-AICoser-TextList
Four text inputs, one list out — assembling prompt batches without the plumbing
- texts
Batch generation lives and dies on lists. You want to try four prompt variants, or generate a subject in three styles and a lighting condition in two - and to do that in ComfyUI, you need a node that turns several separate strings into one list a loop node can iterate over. That's exactly what AICoser_TextList is: up to four connected text inputs in, one list of strings out.
It sits in the unglamorous but load-bearing middle of the graph: the outputs of four TextBoxes (or four template renders) plug in, and what comes out is a STRING list you can feed into any node that iterates batches - this pack even ships the queue-based PromptQueue and BatchLoadImages nodes that expect exactly this shape of data. It's plumbing, but it's plumbing that keeps you from writing five copies of the same subgraph.
How it works
The node collects its connected inputs in order, skips anything not wired, and builds a Python list. Two details are worth knowing:
- Lists pass through flattened. If one of your inputs is already a list (say, from a SplitLines node), its contents are extended into the output rather than nested. So you can chain a SplitLines output in as one "slot" alongside plain text inputs and still get one flat list.
- Empty/unconnected slots are dropped, so you can leave text3 and text4 dangling and the output is just the two-item list. Nothing errors.
It also hashes its inputs for IS_CHANGED, so edits upstream reliably trigger a rerun.
Inputs and output
- text1 … text4 - all optional and wire-in only (
forceInput). Connect TextBoxes, template outputs, or any STRING source. You can't type into these widgets - they're sockets, not fields, which is the intended pattern. - Output: texts (
STRING, as a list) - order follows the slot numbers.
Installing it
Same one-time install as the whole pack:
cd ComfyUI/custom_nodes
git clone https://github.com/aicoser-sister/ComfyUI-AICoser-Tools
Restart ComfyUI, or use ComfyUI Manager and search "ComfyUI-AICoser-Tools". Pure string handling - no extra dependencies.
Common issues
- The output won't connect to my node - a
STRINGlist is a different type from a plainSTRING, and many nodes (like a CLIP Text Encode) only accept the single string. Use the list with nodes that explicitly iterate lists, or pick items out of it with an indexing/switch node. This trips up more people than anything else about this node. - Only four slots? - Yes, it's capped at four inputs. If you need more, chain two TextList nodes together (remember, lists flatten) or use a SplitLines node fed from a multiline text box, which handles arbitrarily many lines.
- An input "isn't showing up" - it's wired but the output seems short. Check whether one of your upstream sources returned an empty list or an unconnected slot was silently dropped; that's expected behavior, not a bug.
It's not exciting. But the first time you run a four-variant batch without hand-editing a prompt four times, you'll understand why it's there.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| text1opt | STRING | — | |
| text2opt | STRING | — | |
| text3opt | STRING | — | |
| text4opt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| texts | STRING | — |