Save Text File (TJ)
Save Text File (TJ)
- text
Sometimes you don't want a prompt in the workflow - you want it on disk, right now, next to the images it generated. Save Text File (TJ) writes a string to a file and passes the same string straight through its output, so you can drop it in the middle of a chain as a logger without breaking the flow. It's the node for "save the prompt that made this" without fighting ComfyUI's metadata embedding or manually copy-pasting.
How it works
Give it text, it writes it. The inputs control exactly where and how:
text- the string to save (prompt, seed list, whatever). It can also be fed wirelessly viaget_name.path- destination, defaultimage/%date(a date-named folder under output).%dateexpands to today.filename_prefix- the base name (defaultimage).filename_delimiter- separates prefix, number, and suffix (default_).filename_number_padding- digit padding on the auto-increment (default 4, soimage_0001.txt).filename_suffix- an optional extra suffix.file_extension- default.txt; change to.json,.md, whatever.encoding- the one that betrays the author's Korean roots:utf-8,utf-8-sig,cp949,euc-kr,ascii. On Windows,cp949/euc-krmatter for Korean filenames/content; everyone else mostly wantsutf-8.
Output: text - the exact string you put in, passed through unchanged. So you can log a prompt to file and keep feeding it downstream in the same wire.
There's also setnode_name for publishing the text to the TJ wireless registry, making it usable as a wireless sender as well as a file writer.
Installing it
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/designloves2/ComfyUI-TJ_NODE
or ComfyUI Manager → ComfyUI-TJ_NODE → restart. No dependencies beyond the pack.
The honest take
It's a utility node and it knows it. The pass-through output is the design detail worth noticing - most "save text" nodes dead-end the flow, but this one lets you log and continue in the same breath. The best pattern is pairing it with the save pipeline: run a Save Image (Primary-TJ) for the picture and a Save Text File with the same prefix for the prompt, and you get main.png + main.txt side by side, everything reproducible without digging into metadata. One practical note: the filename fields are separate widgets, so if you want main_prompt.txt matching a main_0001.png, mirror the prefix and let the padding do the rest. Encoding only becomes your problem if you're writing non-ASCII text on Windows - then utf-8-sig is the safer default than plain utf-8.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| get_name | COMBO | 1 options: (none) | |
| setnode_name | STRING | — | |
| path | STRING | image/%date | — |
| filename_prefix | STRING | image | — |
| filename_delimiter | STRING | _ | — |
| filename_number_padding | INT | 40–12 | — |
| file_extension | STRING | .txt | — |
| encoding | COMBO | utf-8 | 5 options: utf-8, utf-8-sig, cp949, euc-kr, ascii |
| filename_suffix | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |