Save Batch String ๐
Dump a batch of prompts to text files
- prompts
Part of cgem156's batch_condition family, which is built around one idea: handle a whole batch of prompt strings as one object instead of N separate string widgets. This node is the output end of that pipeline for text - it writes every string in a batch out to its own file on disk, one .txt per entry.
How it fits the pack
The batch_condition nodes chain together: BatchString, PrefixString, or RandomColorPrompt produce a BATCH_STRING; CLIPTextEncodeBatch turns that into conditioning for sampling; and SaveBatchString here writes the raw text out for your own records. Run it alongside SaveImageBatch with the same seed value and your saved prompt files line up with the images they generated - that's clearly the intended use of the shared seed input across both save nodes.
Inputs and outputs that matter
prompts- aBATCH_STRING, the whole batch of text at once, not a single string.folder- where to write the files. Left blank, it presumably falls back to a default output location; set it explicitly if you want your batch runs organized by name.extension- file extension for each saved file, defaults totxt.seed- used to name/number the output files. This is anis_output_node, so it has no data outputs of its own - it's a terminal node in your graph.
Installing it
ComfyUI Manager โ search cgem156-ComfyUI๐ โ install โ restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/laksjdjf/cgem156-ComfyUI
then restart ComfyUI. Nothing extra needed for this node.
Common issues & troubleshooting
Nothing shows up as a node output. That's expected - this is a save/output node (is_output_node: true), same category as SaveImage. It writes to disk; it doesn't pass anything downstream. If your graph looks "dead-ended" here, that's correct, not broken.
Files aren't where you expected. Check the folder field first - if it's empty, ComfyUI's own default output directory is the likely landing spot. Set it explicitly for anything you plan to revisit.
Prompt files and image files don't match up. Use the same seed on this node and on SaveImageBatch for a given run. They're separate nodes with separate seed fields, so nothing stops you from accidentally leaving one on a stale value while you change the other - worth a quick glance before a long batch run.
Only one file instead of a batch. Double-check the upstream node is actually producing a BATCH_STRING with more than one entry - if you fed it a single StringInput instead of a BatchString/RandomColorPrompt/PrefixString output, you'll get a "batch" of one, which is technically correct but probably not what you meant to wire up.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| prompts | BATCH_STRING | โ | |
| folder | STRING | โ | |
| extension | STRING | txt | โ |
| seed | INT | 00โ18446744073709550000 | โ |
Outputs (0)
No outputs