🐟String List
Pick your prompts by number, in order, or at random
- string_list
- string_list
- strings
If you've ever wanted one workflow that silently pumps out a different prompt each run - a prompt roulette for batch generation - this is the node for it. 🐟String List is the flagship of the ComfyUI-String-Helper pack: it holds up to ten multiline strings and hands you one or more of them, selected the way you tell it to. No translation magic, no models, nothing clever hiding under the hood - just string selection done properly.
What it does
The node is basically ten text boxes plus three competing selection modes. You type strings into string1 through string10 (or wire text in from upstream nodes - the slots are plain STRING inputs), optionally bolt on an external string_list, and then pick a mode. There's a strict priority order baked into the design, and it's the one thing that trips everyone up:
- p1_select_by_numbers - the boss. Put
1,3,5in here and you get exactly those entries (1-based), in that order. - p2_select_sequential - flip this to
trueand each execution returns the next string, wrapping around to the start when it hits the end. Classic "one prompt per queue run" behavior. - p3_select_random_count - the default mode, and the weirdest of the three.
-1means "everything,"0means "nothing," and any number from 1–10 means "that many random picks." Note it draws without replacement -random.sample- so you won't get duplicates in a single pick.
There's also a translate_output toggle: flip it on and whatever got selected is sent through a free Bing translator and returned in English. More on that translator below, because it's the pack's one real dependency and its one real caveat.
The outputs
Two outputs, same data: string_list is the LIST you wire into batch/batching nodes, and strings is the same content as a list of STRINGs (ComfyUI treats it as one string per slot for downstream text nodes). Most people wire strings into a prompt text encode and let the node's IS_CHANGED = true flag do the work - that flag is the secret sauce, it forces the node to actually re-execute on every queue run so sequential and random modes genuinely rotate instead of caching the first result forever.
Installing it
From ComfyUI Manager, search "ComfyUI-String-Helper" and install. Or, by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/liuqianhonga/ComfyUI-String-Helper.git
Restart ComfyUI. The pack's only real dependencies are translators and chardet - tiny pip packages, no models, no download drama. If you're on an offline box, skip the translation toggle and the node still works fine.
Gotchas
The translator is the part to be wary of. It's the free Bing endpoint wrapped by the translators library, so it needs internet and it's rate-limited and occasionally flaky - failures come back as [翻译失败] ... strings baked straight into your output, which is quietly horrible if you didn't notice. Keep translation off unless you actually want it.
Also: the README for this pack is written in Chinese and describes an older translate_string CSV column - the code reads string / zh / tags instead. For this node it doesn't matter (no CSV involved), but keep it in mind if you graduate to the pack's CSV siblings.
For a beginner's ComfyUI overview, the ecosystem doc in our KB is worth a skim - this node solves the "batch variation" problem that's a big reason people abandon A1111 for the node graph in the first place.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| p1_select_by_numbers | STRING | — | |
| p2_select_sequential | BOOLEAN | false | — |
| p3_select_random_count | INT | -1-1–10 | — |
| translate_output | BOOLEAN | false | — |
| string1 | STRING | — | |
| string2 | STRING | — | |
| string3 | STRING | — | |
| string4 | STRING | — | |
| string5 | STRING | — | |
| string6 | STRING | — | |
| string7 | STRING | — | |
| string8 | STRING | — | |
| string9 | STRING | — | |
| string10 | STRING | — | |
| string_listopt | LIST | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| string_list | LIST | — |
| strings | STRING | — |