IF Save Text📝
Log Every LLM Turn to CSV, JSON, or Plain Text
- Question
- Response
- Negative
- Turn
If you're running an LLM node in a loop - say, generating a batch of prompts for image generation - you quickly lose track of what question produced what answer. IF_LLM_SaveText is the pack's answer: it captures a full turn (question, response, negative prompt) and, when you ask it to, writes that turn to disk as CSV, TXT, or JSON.
This is the node you want when you're building a dataset or auditing your prompt pipeline. A run produces dozens of LLM responses; without a log you have no way to trace "that weird prompt came from that weird input."
How it works
Three required inputs, all wired in: question_input, response_input, and negative_input - the natural match for the main IF_LLM node's question, response, and negative outputs. Every run, the node bundles them into a turn and stamps it with a fresh UUID.
The save_file boolean controls whether anything touches disk. If it's off, the node just echoes its inputs back. Turn it on and file_format (csv, txt, or json) plus save_mode (create, overwrite, or append) decide how. create makes a new file, overwrite clobbers, append keeps growing it - which is what you want for a running log.
Outputs are the four things you'd expect: Question, Response, and Negative passed through unchanged, plus Turn - a formatted string with the ID and all three fields, handy for a display node.
Files land in custom_nodes/ComfyUI-IF_LLM/IF_AI/saved_outputs/, named output.csv / output.txt / output.json depending on the format you chose.
Installing it
Same pack, one install. ComfyUI Manager (search "IF_LLM") or:
cd ComfyUI/custom_nodes
git clone https://github.com/if-ai/ComfyUI-IF_LLM
then restart. The README's standing warnings apply: conflicts with IF_AI_tools (uninstall it first), and the dependency list is substantial.
Troubleshooting
- The file isn't where you expect - it writes under the ComfyUI install's
custom_nodesfolder, not your working directory. If you're running a portable install, that'sComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-IF_LLM\IF_AI\saved_outputs\. - Nothing is saved even though
save_fileis on - checksave_mode. If you pickedcreateandoutput.csvalready exists from an earlier run, the behavior you actually want is probablyappendoroverwrite. - JSON mode looks odd on append - the JSON append path rewrites the file into a list. If you're mostly appending, CSV or TXT is the more forgiving format.
The one design quirk worth knowing: negative_input is required, so if your LLM pipeline never produces a negative prompt, wire in an empty string and move on. A small thing to remember, but it'll save you a confused "why won't this node run" moment.
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 | — |