Save Text Custom Node
Write any string to a file on disk
- text
- STRING
Images aren't the only thing worth writing to disk. This node takes text and saves it to a file - prompts, captions, logs, generated tags, whatever string is floating around your graph. If you've ever wanted the prompt that made an image saved next to that image, or you're building a captioned dataset, this is the piece that closes the loop.
The obvious use is caption files. Training a LoRA or building a dataset means every image needs a matching .txt with its caption. Wire your prompt or your tagger output into this node, match the filename to the image, and you've got the paired text files trainers expect - no manual copy-paste. The other use is plain logging: dump the parameters, the seed, the model name, or any assembled string so you have a record of what a run actually did.
The inputs that matter
- text - the string to write. Its type is "any," so you can feed it strings directly or wire in something that isn't strictly a string and it'll take it. This is the payload.
- filename_prefix (default
ComfyUI) - the base name. - subfolder_dir - an output subfolder, for keeping things organized.
- filename - an explicit filename if you want to control it precisely rather than lean on the prefix. This is what you'd set to make the text file's name line up with a matching image.
It's an output node, so it runs on every queue. The output is a STRING - the saved path - which you can chain onward if a later step needs to know where the file landed.
The dataset angle
It's no accident this pairs so naturally with dataset work. The pack's author, aria1th (AngelBottomless), trained the Illustrious XL models and publishes booru dataset dumps - building image/caption pairs at scale is exactly the workflow this node is shaped for. If you're assembling training data inside ComfyUI (generate or load an image → tag it → save the image and its caption side by side), this is the caption-writing half of that loop.
Installing ComfyUI-LogicUtils
ComfyUI Manager: Install Custom Nodes → search "ComfyUI-LogicUtils" → install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils
Restart ComfyUI. No dependencies - it's writing a text file.
Worth knowing
The pack is undocumented by design (the README says as much). The one thing to watch: to make caption files line up with images, you need the text filename to match the image filename, so set filename deliberately rather than relying on the auto-numbered prefix, which won't necessarily track your image saver's numbering. Get the naming aligned and this quietly does the tedious half of dataset prep for you.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| text | * | — | |
| filename_prefix | STRING | ComfyUI | — |
| subfolder_dir | STRING | — | |
| filename | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |