Debug Text Saver
Dump Any String to a File With a Timestamp (and Not a Security Hole)
- file_path
Every so often you just need to see what a string actually is. Debug Text Saver takes any STRING in your graph, prepends a [2026-08-16 14:22:03]-style timestamp, and writes it to a file in ComfyUI's output folder. It's the poor-man's logger for prompt pipelines: when a composed prompt isn't what you thought, or a node upstream is quietly returning garbage, you wire this in, run once, and open the file.
It's part of artyclaw/artyclaw-comfy, the author's personal pack. The header comment in the source tells a small story: version 1.0.1 was a "Security fix - Restricted file writing to the ComfyUI output directory to prevent arbitrary path access." So yes, a personal utility got hardened - you're getting the safe version.
How it works
The node normalizes escaped sequences before writing (\r\n, \n, \r, \t as literal text become real line breaks, and doubled backslashes collapse), strips the string, prepends the timestamp, and writes to:
<ComfyUI output dir>/<output_subfolder>/<file_name>.<file_extension>
So the defaults land at ComfyUI/output/debug/debug_log.txt. append toggles between overwrite (w, default) and append (a). The output directory restriction means you can't write outside the output folder even if you try - subfolders get scrubbed of .. traversal and leading slashes, and there's a final containment check that blocks the write and returns an empty string if the path escapes. The file name is sanitized to safe characters.
The inputs that matter
- string - the text to log. This is the one you wire from upstream.
- output_subfolder - subfolder under the output dir (default
debug). - file_name - base name (default
debug_log).
Optionals: file_extension (.txt), append (false).
The output is file_path - the absolute path it actually wrote to, so you can surface it in the UI or chain it into something that reads the file back.
Install
ComfyUI Manager → search ArtyClaw Comfy Nodes, or:
cd ComfyUI/custom_nodes
git clone https://github.com/artyclaw/artyclaw-comfy
Restart. No dependencies beyond Python's stdlib and folder_paths, which every ComfyUI install has.
Where people get burned
The most common confusion is where the file went - it's not in your working directory, it's under ComfyUI/output/, and the output_subfolder nests under that. Second: with append off (the default), every run overwrites the previous log, so a loop of 50 generations leaves you with only the last entry. If you're logging a batch, flip append on. Third, the node prints [DebugTextSaver] --- run start --- to the console on every execution even in normal use, which reads like a problem when it isn't - that's just how it's written. And if you ever see a "Security block" message, your output_subfolder tried to escape the output dir; it's working as designed, not broken.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| string | STRING | — | |
| output_subfolder | STRING | debug | — |
| file_name | STRING | debug_log | — |
| file_extensionopt | STRING | txt | — |
| appendopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| file_path | STRING | — |