π FRED Save Text File
Write text to a file from your workflow β append, overwrite, or never clobber
- SUCCESS?
- STATUS
- help
ComfyUI will happily hand you prompts, seeds, and metrics as text strings - and then make you copy them by hand if you want them on disk. FRED_Save_Text_File writes text from your graph directly to a file, with three write modes and a duplicate-skip that makes it safe to use as an append-only log. It's a small node, but it's the missing end of the wire for any "record what this run did" workflow.
The inputs
text- the string to write. Feed it a prompt, a seed, a metric, or a concatenation of them.folder_path(default.) - where the file goes. Relative paths resolve from ComfyUI's working directory, or use absolute.file_name(defaultout) andfile_extension-.txt,.csv, or.json. Note the extension is a dropdown with the leading dot built in.mode- the behavior:- append - add to the file, creating it if missing.
terminator(default on) adds a line break before each append so entries don't merge together. - overwrite - replace the whole file each run.
- new only - write only if the file doesn't exist yet. Your built-in "don't clobber my work" guard.
- append - add to the file, creating it if missing.
skip_if_duplicate(default on) - in append mode, if the exact text is already in the file, it skips the write. This is the setting that turns the node into a deduplicating log: same prompt twice in a batch β recorded once.
The outputs
SUCCESS?(BOOLEAN) - did the write happen (or get skipped cleanly)?STATUS(STRING) - human-readable result:file appended,file overwritten,file created,text already exist,file already exist, etc. Wire this into a text display to see what happened without opening the file.
What you'd use it for
- Automatic run logs. Pipe
execution_time_strfrom FRED_ExecutionTime, a seed, and a prompt into the text input; append mode; every run adds a line. Your own benchmark history with zero manual work. - Prompt/tag collection. Dump the prompts you actually liked into a
.csvas you generate, deduped byskip_if_duplicate, and you've slowly built a usable prompt library. - Dataset labels or sidecars. Write JSON per image or per batch for a training run.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Poukpalaova/ComfyUI-FRED-Nodes_v2.git
Restart, or "ComfyUI FRED Nodes v2" via ComfyUI Manager. No extra dependencies - it's plain file I/O.
Gotchas
Two worth knowing. First, .csv output is raw text, not quoted/escaped CSV - if your text contains commas, don't expect spreadsheet-grade parsing without doing your own formatting. Second, new only is a once-ever guard per filename: if the file exists from a previous session, it stays unwritten forever, which is exactly what it promises but easy to forget when you're testing and the node "does nothing." Delete the file (or change the name) to reset it.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | . | Target folder (relative or absolute). Will be created if missing. |
| file_name | STRING | out | Output file name without extension |
| file_extension | COMBO | .txt | File extension to use |
| mode | COMBO | How to write: Append (add), Overwrite (replace), or New Only (create if missing) | |
| terminator | BOOLEAN | true | Add a line break in append mode before writing text |
| skip_if_duplicate | BOOLEAN | true | If enabled (append mode), do not write if this text already exists in the target file. |
| text | STRING | Text to write to the file. Right click and convert to input for dynamic content. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| SUCCESS? | BOOLEAN | True if file written/skipped as intended, False on error |
| STATUS | STRING | Operation result: file appended, file overwritten, file created, text already exist, file already exist, error |
| help | STRING | This message (detailed help/instructions) |