String List From Newline
Paste a wall of prompts, get a list out
- Strings
- Num Strings
You've got twelve prompts in a text file and you want every one of them generated. Manually stacking text boxes works up to about seven, and by the time you're on box nine your graph looks like a game of Jenga. String List From Newline is the fix: one big multiline box, one line per prompt, and out the other side comes a proper list of strings.
The name gives the whole game away - every line break becomes a new item. Type (or paste) this:
a cat astronaut
a dog astronaut
a raccoon astronaut
and you get a three-element string list, plus Num Strings reporting 3 as an INT. Wire the Strings output into anything that eats a string list - a prompt input on a sampler, or the X or Y input on XYAny for a quick prompt-sweep grid - and each item runs through the batch.
Mechanically there's nothing to it. The node runs Text.split("\n") on whatever you typed, which is exactly as predictable as it sounds. Which brings us to the one trap that will genuinely cost you a render: a trailing newline adds an empty string to the list. Type a final Enter after your last line and you get ["a cat astronaut", "a dog astronaut", "a raccoon astronaut", ""]. That blank entry becomes a fourth prompt - an empty-text generation you didn't plan for, and often a wasted sample or a broken grid cell. Same deal with blank lines mid-list: "a\n\nb" splits into ["a", "", "b"]. It's not a bug, it's just what split does, but it's the thing I'd bet on catching you once.
That quirk is the main difference between this node and its sibling String List (KepStringList) in the same pack. String List gives you up to seven separate text boxes and silently drops empty optional ones, while this one happily passes empties through - so pick per use case: fixed small set → String List, big paste-heavy batch → this.
If you're comparing it to the pack's Range nodes: those generate numbers for sweeps; this generates the text side. They meet in XYAny, where a string list on one axis and a float range on the other is the classic checkpoint-vs-CFG or prompt-vs-seed grid.
Install is the usual ComfyUI custom-node dance, and there's nothing special here - no requirements.txt, no model files, nothing to pip install:
cd ComfyUI/custom_nodes
git clone https://github.com/M1kep/Comfy_KepListStuff
Restart ComfyUI (or use Manager and search Comfy_KepListStuff), and look under List Stuff. Then paste your prompts, count the Num Strings once, and stop worrying about the empty line at the end - for real, delete that trailing newline.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| Text | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| Strings | STRING | — |
| Num Strings | INT | — |