IF Save Text📝
Keep every LLM conversation turn out of the ether
- Question
- Response
- Negative
- Turn
IF Save Text exists because the rest of this pack is talkative. The IF nodes - Chat Prompt, Image Prompt, Prompt Maker - spend their whole lives producing strings, and unless you capture them, those strings vanish the moment the graph finishes. This node sits at the end of the line, takes the question/response/negative triple from an LLM node, and writes it to disk so you've got a record of every turn.
If you've ever run a batch of prompt-reversed images and then lost the exact prompt that made one of them, you know why this exists. It's the pack's built-in paper trail.
How it works
You wire it up after an LLM node: question_input, response_input, and negative_input are forced inputs that expect strings from upstream. By default (save_file off) it does nothing but pass everything through - so it also works as a harmless tee in the graph. Flip save_file on and it writes to a turn_data record with a freshly generated UUID.
Where does it go? The code builds a path under your ComfyUI folder:
ComfyUI/custom_nodes/ComfyUI-IF_AI_tools/IF_AI/saved_outputs/output.<format>
Three formats, three behaviors. txt appends a text dump per turn. csv writes question/response rows with a header. json keeps a structured list of turn objects - the append save mode is the one you want for an ongoing log, because create and overwrite both start the file fresh each run.
The inputs that matter
question_input,response_input,negative_input- wire these from any IF LLM node's matching outputs.save_file- the master switch. Off by default, which trips people up.file_format-csv,txt, orjson.save_mode-create,overwrite, orappend.
Outputs are mostly pass-throughs - Question, Response, Negative - plus Turn, a single string containing the UUID and the whole transcript, handy if you want to log the entire exchange as one blob.
Installation
Standard for this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/if-ai/ComfyUI-IF_AI_tools.git
pip install -r requirements.txt
Or install "IF_AI_tools" via ComfyUI Manager and restart. No extra model downloads - this node is pure plumbing.
Gotchas
The trap is save_mode. People set save_file on, run a batch, and find only the last turn on disk - because create/overwrite truncate every execution. Use append for anything longer than one run. Also note the output directory is inside the custom_nodes folder, which means a ComfyUI update that wipes custom_nodes takes your logs with it; treat it as a working buffer, not an archive. And yes, this pack is archived - but a file-writing pass-through node is exactly the kind of thing that doesn't rot.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| question_input | STRING | — | |
| response_input | STRING | — | |
| negative_input | STRING | — | |
| save_fileopt | BOOLEAN | false | — |
| file_formatopt | COMBO | 3 options: csv, txt, json | |
| save_modeopt | COMBO | 3 options: create, overwrite, append |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| Question | STRING | — |
| Response | STRING | — |
| Negative | STRING | — |
| Turn | STRING | — |