Nodes/ComfyUI_AceNodes/πŸ… Text Save
ComfyUI Node

πŸ… Text Save

Stop losing LLM output β€” save text straight to your output folder

By hay86Β·Created 2 years agoΒ·Updated about a year agoΒ· 96
πŸ… Text Save
    • STRING
    β—„textβ–Ί
    β—„filename_prefixComfyUIβ–Ί
    β—„file_extension.txtβ–Ί

    ComfyUI saves images beautifully and text almost not at all. If you've ever run an LLM node, gotten a great caption, and then had it vanish into the void of a re-queue, πŸ… Text Save is the fix: it writes whatever string you hand it to disk in ComfyUI's output directory, auto-numbers the file so nothing gets overwritten, and - the nice part - returns the full path it wrote to. Text finally leaves the graph as something you can keep.

    How it works

    The required inputs are text (multiline STRING, the content to save) and filename_prefix (a STRING defaulting to ComfyUI, the base name). There's one optional input, file_extension, defaulting to .txt. On execution the node writes the text to ComfyUI/output/<filename_prefix>_<counter>.txt - the counter increments per run, so saving twice with the same prefix gives you two files instead of one clobbered file. The node is marked as an output node, so it runs as a terminal step, and it returns the full file path as its STRING output.

    Note the extension behavior: the default value is .txt and it's used as-is, so if you change it to md without the dot you'll get a file named something_00001_md. Keep the dot. It's a small detail that costs a confused folder listing.

    Inputs and outputs

    • text - STRING, multiline. What gets saved.
    • filename_prefix - STRING, default "ComfyUI". Base filename.
    • file_extension - STRING, optional, default ".txt".
    • Output: STRING - the absolute path of the written file.

    Where it shines

    The killer pairing is with the pack's πŸ… OpenAI GPT Chat node: generate a caption or a rewritten prompt, wire the STRING output straight into text, and every run's result is preserved as a file you can browse later. Pair it with πŸ… Text Load for the round-trip. It's also the clean way to log intermediate text during debugging - being able to read exactly what your text chain produced mid-pipeline beats squinting at a console.

    Install

    Ships in hay86/ComfyUI_AceNodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/hay86/ComfyUI_AceNodes
    cd ComfyUI_AceNodes
    pip install -r requirements.txt
    

    Restart ComfyUI and look for πŸ… Text Save under Ace Nodes. Manager users search ComfyUI_AceNodes.

    Gotchas

    Files land in the ComfyUI output directory, numbered per prefix - that's the pattern, not a bug. Remember the .txt default needs its dot if you change extensions. And the pack's usual install weight applies: the full requirements.txt (rembg, transformers, boto3, insightface…) comes along even though this node is pure file I/O. For anything where you want text to survive the session, though, it's the right tool.

    CategoryAce Nodes

    Inputs (3)

    NameTypeDefaultDescription
    textSTRINGβ€”
    filename_prefixSTRINGComfyUIβ€”
    file_extensionoptSTRING.txtβ€”

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGβ€”