Nodes/ComfyUI_yanc/๐Ÿ˜ผ> Save Image
ComfyUI Node

๐Ÿ˜ผ> Save Image

Subfolders, date placeholders, and a warning before you overwrite something

By ALatentPlaceยทCreated 2 years agoยทUpdated 2 years agoยท 80
๐Ÿ˜ผ> Save Image
  • images
    โ—„filename_prefixComfyUIโ–บ
    โ—„folderโ–บ
    โ—„overwrite_warningfalseโ–บ
    โ—„include_metadatatrueโ–บ
    โ—„extensionโ–พโ–บ
    โ—„quality95โ–บ
    โ—„filename_optโ€”โ–บ

    Vanilla ComfyUI's Save Image dumps everything into one flat output folder with an auto-incrementing prefix, which gets unmanageable fast once you're running more than a handful of workflows. YANC's Save Image adds the two things people actually want: a target subfolder (created automatically inside your output directory) and control over metadata/format, plus a genuinely useful safety net - a warning before it silently overwrites a file.

    The README documents date/time placeholder codes (%d day, %m month, %Y/%y year, %H/%I hour, %M minute, %S second, %p AM/PM) you can drop into the folder and filename fields, so you can organize output by date automatically instead of building that logic yourself with Text Combine and a date node.

    How it works

    It saves the incoming image batch the same way the vanilla node does, but resolves folder and filename_prefix as paths (creating the folder if it doesn't exist) and, if either field contains a placeholder code, substitutes in the current date/time before writing. include_metadata controls whether the workflow itself gets embedded in the PNG (so you can drag the saved image back into ComfyUI to reload the exact graph that made it) - a very handy default to leave on for anything you might want to reproduce later.

    The inputs and outputs that matter

    • images - the IMAGE batch to save.
    • filename_prefix (default "ComfyUI") and folder (default empty, meaning the root output directory) - where and what to name the files. Both can contain the date placeholders above.
    • overwrite_warning (BOOLEAN, default false) - flip this on and the node warns you if it's about to write over an existing file instead of doing it silently. Worth turning on any time filenames aren't dynamically changing between runs.
    • include_metadata (default true) - embeds the workflow JSON in the saved PNG. Leave it on unless file size or stripping traceable data matters to you.
    • extension (png or jpg) and quality (default 95, 0โ€“100, JPEG quality only) - pick PNG for lossless/metadata-preserving saves, JPEG for smaller files where you don't need the embedded workflow.
    • filename_opt (optional STRING) - connect a dynamic value here (say, the file_name output of Load Image From Folder, run through Text Combine) to control the exact filename yourself.

    No outputs - this is a terminal, output node, same as the vanilla Save Image.

    How to install it

    Via ComfyUI Manager: search "yanc" or "YANC - Yet Another Node Collection," install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ALatentPlace/ComfyUI_yanc
    

    then restart. No extra dependencies or downloads.

    Common issues & troubleshooting

    Images keep getting overwritten. This is the one the README calls out directly as important: the moment you connect filename_opt, the filename stops being dynamically generated (no more auto-incrementing counter), so every run with the same filename_opt value overwrites the last one. If that's not what you want, either leave filename_opt disconnected and let the node auto-name files, or make sure whatever feeds filename_opt actually changes between runs.

    JPEG quality looks visibly worse than expected. quality only applies to the jpg extension - if you're on png and seeing compression artifacts, that's not this node; PNG is lossless. Check extension is actually set to what you think it is.

    Metadata missing when you try to drag an old image back into ComfyUI. Only happens if include_metadata was off for that save, or if the file went out as JPEG rather than PNG (workflow embedding is a PNG-metadata trick and doesn't survive a JPEG re-encode the same way). Save critical/reproducible outputs as PNG with metadata on.

    CategoryYANC/๐Ÿ˜ผ Image

    Inputs (8)

    NameTypeDefaultDescription
    imagesIMAGEโ€”
    filename_prefixSTRINGComfyUIโ€”
    folderSTRINGโ€”
    overwrite_warningBOOLEANfalseโ€”
    include_metadataBOOLEANtrueโ€”
    extensionCOMBO2 options: png, jpg
    qualityINT950โ€“100โ€”
    filename_optoptSTRINGโ€”

    Outputs (0)

    No outputs