🐟Json To CSV
The boring little node that feeds your caption library
- message
This is the pack's least glamorous node and the one that quietly makes the rest of it useful. 🐟Json To CSV takes a single JSON object and writes it as one row into a CSV file - the exact format that StringListFromCSV reads back. Think of it as the "save this for later" end of a caption pipeline: you've got an LLM node outputting structured descriptions, you want them accumulated into a prompt library you can sample from next week, and this node is the glue.
What it actually does
You feed it a JSON string with exactly three fields - description, zh, and tags - and it appends one row to the CSV:
{"description": "a woman sitting on stairs", "zh": "坐在楼梯上的女人", "tags": "portrait, casual"}
The row lands in the file as string (the description), zh (the Chinese translation), tags. If any of the three required fields is missing, it doesn't crash - it returns an error message string instead. Same if the JSON won't parse. You see the message in the UI and on the console, and you fix your JSON.
Inputs and output
Three inputs, all simple: json_string (multiline, the JSON), csv_file (default output/string_list_output.csv - and yes, that's a relative path, resolved against the folder above your ComfyUI install, so consider using an absolute one), and append_mode (default true, meaning rows get added to whatever's already there). With append off, the file is overwritten.
One output, message, a STRING that tells you what happened: Successfully wrote 1 row(s) to ... or Skipped 1 duplicate row(s) when append mode catches a string it's already seen. Deduplication is by the string column, which is a thoughtful default - rerun a workflow and you don't grow duplicate rows.
Why you'd reach for it
It's an output node, so you won't wire its message into the image pipeline - you'll wire its input from an LLM captioning node or a manual JSON you're testing, and let it persist to disk. The intended loop, and it's a nice one: JsonToCSV writes captions → StringListFromCSV samples them for prompt rotation → you grow a bilingual caption library over time without ever hand-editing a spreadsheet. The pack also has StringListToCSV for the case where you're saving plain strings (with optional auto-translation) instead of hand-built JSON.
Installing
From ComfyUI Manager, search "ComfyUI-String-Helper". Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/liuqianhonga/ComfyUI-String-Helper.git
Restart ComfyUI. Dependencies are just translators and chardet - nothing heavy.
The honest caveats
There's no translation happening here - you're responsible for the zh field, which means this node pairs naturally with an LLM that can produce bilingual captions in one shot. And note the README's stale docs again: it describes a translate_string column, but the code (and every other node in this pack) uses string, zh, tags. Match that and you're fine.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| json_string | STRING | — | |
| csv_file | STRING | output/string_list_output.csv | — |
| append_mode | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| message | STRING | — |