🐟String List From CSV
Same prompt roulette, fed from a spreadsheet instead of ten text boxes
- string_list
- string_list
- strings
🐟String List From CSV is the spreadsheet version of the pack's StringList node. Where that node makes you type ten strings into ten boxes, this one pulls from a CSV file - which means a hundred strings, or a thousand, cost you nothing extra in graph real estate. Same selection engine underneath, and if you already know StringList this is a straight upgrade for any serious prompt library.
The CSV format (read this, the README is wrong)
The node expects a CSV with three columns: string, zh, and tags. string is the raw text, zh is a Chinese translation of it, and tags is a comma-separated tag list. The README still talks about a translate_string column - ignore that, the code reads string / zh / tags. A template/string_list.csv ships inside the pack as a worked example: image descriptions with Chinese captions and tags like "休闲 (casual), 女孩 (girl)".
Encoding is handled for you. The node sniffs the file with chardet and handles UTF-8 plus GBK, GB2312, GB18030, and BIG5 - a genuinely nice touch if you're working with Chinese-language data that usually arrives as GBK garbage in other tools.
The inputs that matter
- csv_file - path to the file. Default is
template/string_list.csv, and here's the trap: relative paths resolve against the folder above your ComfyUI install (two levels up fromcustom_nodes), not the pack folder or your project. In practice, give it an absolute path and skip the guessing game. - use_translated - read the
zhcolumn instead ofstring. For a bilingual caption library, this is the feature that makes the node worth having. - filter_tags - comma-separated tags; only rows whose
tagscolumn contains any of them pass through. Great for slicing "portrait only" or "landscape only" out of one big file. - p1_select_by_numbers / p2_select_sequential / p3_select_random_count - the same priority-ordered selection engine as
StringList: by-number wins, then sequential cycling, then random count (-1= all,0= none). - reuse_last_result - this is the interesting one. Leave it
trueand the node keeps returning the same random pick on every run until you flip it off, grab a fresh pick, and flip it back. Perfect for "lock this prompt while I fiddle with the sampler, then reroll."
Plus translate_output (to English) and an optional string_list input that appends extra strings to whatever came out of the CSV.
Outputs
Same pair as StringList: string_list (LIST) and strings (list of STRINGs). Wire strings into your text encoder for batch prompt rotation.
Installing
ComfyUI Manager, search "ComfyUI-String-Helper", install, restart. By hand:
cd ComfyUI/custom_nodes
git clone https://github.com/liuqianhonga/ComfyUI-String-Helper.git
Dependencies are just translators and chardet - no models, no heavy installs.
Gotchas
The translation features (both directions) ride the free Bing endpoint, so they need internet and can hiccup - failures surface as literal [翻译失败] ... text in your output. The reuse_last_result state lives on the node instance in memory, so it resets when you reload the workflow. And if your CSV is missing or malformed, the node quietly returns an empty list rather than an error - a silent empty strings into your prompt encoder is a confusing way to find out.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| csv_file | STRING | template/string_list.csv | — |
| use_translated | BOOLEAN | false | — |
| filter_tags | STRING | — | |
| p1_select_by_numbers | STRING | — | |
| p2_select_sequential | BOOLEAN | false | — |
| p3_select_random_count | INT | -1-1–999999 | — |
| translate_output | BOOLEAN | false | — |
| reuse_last_result | BOOLEAN | false | — |
| string_listopt | LIST | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| string_list | LIST | — |
| strings | STRING | — |