Nodes/ComfyUI_LC123_nodes/πŸ“ LC Save Text
ComfyUI Node

πŸ“ LC Save Text

Save a prompt to disk without a regex rodeo

By lonecatone23Β·Created 2 months agoΒ·Updated about 12 hours agoΒ· 19
πŸ“ LC Save Text
    • text
    β—„textβ€”β–Ί
    β—„filename_prefixComfyUIβ–Ί
    β—„formattxtβ–Ί

    Sometimes the thing you want out of a run isn't an image - it's the prompt that made it, the caption that goes with it, or a CSV you'll feed into something else. ComfyUI has plenty of "show text" nodes for eyeballing, but a reliable "write this string to a file" has always been oddly hard to come by. LC123SaveText is that node: you give it text, a filename, and a format, and it writes the file under ComfyUI's output folder, then hands the text back out so you can keep using it downstream.

    The part that makes it better than rolling your own Save Text is the filename handling. filename_prefix accepts subfolders (prompts/2026/anime works fine), and every segment is sanitized for Windows-illegal characters - \ / : * ? " < > | and control characters get replaced with _. That's the whole reason this node exists in this pack, and it's a real one: the classic homemade Save Text node starts throwing exceptions the first time someone's prompt generates a filename with a : or a ? in it, usually right in the middle of a long batch. This one can't explode that way.

    It also de-conflicts names automatically. First save uses stem.ext; if that exists, it steps to stem_01.ext, stem_02.ext, and so on - never overwrites, which is exactly what you want when every run is a record you might need later.

    The format dropdown is txt, md, json, or csv, and it just controls the file extension. The node doesn't validate or pretty-print your content - if you want valid JSON you should be feeding it valid JSON. It's a writer, not a linter.

    That's the whole surface area, honestly: text in, text back out, a filename_prefix, a format. It's flagged as an output node (is_output_node: true), so it runs at the end of every queue and it's where a graph terminates. Common pairing: hang it off an LC Show Text or a prompt-assembly chain, wire the filename from a seed or a %date%-style stamp, and you've got a prompt log that survives even when your workflow crashes later.

    Where people get confused: the text output. Yes, it outputs the same string you put in. That's deliberate - it lets you drop this node in the middle of a chain without breaking the flow, not just at the end. And note it writes under ComfyUI's output folder, not a custom path; if you want absolute control over the directory, that's what LC Advanced Folder is for.

    Install is the standard LC123 one - ComfyUI Manager (search "LC123") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes
    

    Then restart. No pip dependencies, no models to download - it's a text writer, and it's the least dramatic node in the pack, which is precisely why you'll reach for it all the time.

    CategoryLC123/utils

    Inputs (3)

    NameTypeDefaultDescription
    textSTRINGβ€”
    filename_prefixSTRINGComfyUIFile name (and optional subfolders). Illegal path characters are replaced with _.
    formatCOMBOtxt4 options: txt, md, json, csv

    Outputs (1)

    NameTypeDescription
    textSTRINGβ€”