Nodes/ComfyUI-QHNodes/🐟File Save
ComfyUI Node

🐟File Save

Write a node's text output to a real file on disk

By liuqianhonga·Created 2 years ago·Updated about a year ago· 5
🐟File Save
    • filepath
    content
    filenameoutput
    filetypetxt
    folder

    ComfyUI is great at moving images and latents around, but persisting a plain string - a generated caption, a log line, a JSON blob - usually means bolting on something custom. FileSave is that missing piece: hand it text and it writes a file, no more, no less.

    How it works

    You give it content, a filename, a file type, and a target folder; it writes the content to disk at that location and hands back the path it used. It's a generic sink for anything that ends up as a STRING in your graph - a caption from the pack's own Gemini node, a value pulled out with JsonUnpack, the result of a DynamicExpression, or just a prompt you want archived alongside the image it generated.

    The inputs and outputs that matter

    • content (STRING, multiline, required) - the text to write. This is the one input that has to come from somewhere real; everything else has a default.
    • filename (STRING, default "output") - the base filename, without the extension.
    • filetype - an extension picker: txt, json, csv, md, py, html, css, js, xml, yaml, ini, log, and one more, 13 in total. Given that filename defaults to a bare "output" with no extension, this is almost certainly what gets appended to produce the actual file on disk.
    • folder (STRING, default empty) - where to write it, relative to ComfyUI's root unless you give an absolute path.

    Output: filepath (STRING) - the full path it wrote to, useful for chaining into a display node or another node that needs to know where the file landed.

    How to install it

    Search ComfyUI-QHNodes in ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/liuqianhonga/ComfyUI-QHNodes.git
    

    Restart. Main-repo node, nothing extra to fetch.

    Common issues & troubleshooting

    "Folder doesn't exist" errors. The README is explicit about this one: if the target folder doesn't already exist, the node reports an error rather than creating it for you. Make sure the destination folder exists before running the graph - this isn't a mkdir -p-style node.

    Files landing somewhere unexpected. An empty or relative folder value resolves against ComfyUI's root directory, not the custom_nodes folder and not your current working directory when you launched ComfyUI. If you're not sure where a file went, check filepath in the node's output rather than guessing.

    Overwriting a previous run's output. There's nothing in the schema suggesting automatic timestamping or incrementing filenames - every run with the same filename and folder will overwrite the last one. If you're saving something per-run (a log, a caption per generation), you'll want to build the filename dynamically upstream (a timestamp or a counter fed into filename) rather than leaving it static.

    Category🐟QHNodes

    Inputs (4)

    NameTypeDefaultDescription
    contentSTRING
    filenameSTRINGoutput
    filetypeCOMBOtxt13 options: txt, json, csv, md, py, html, +7
    folderSTRING

    Outputs (1)

    NameTypeDescription
    filepathSTRING