Nodes/ComfyUI-Prompt-Helper/Save Image (dir)
ComfyUI Node

Save Image (dir)

PNGs where you say, with filenames you control

By Elypha·Created 2 years ago·Updated 12 months ago· 0
Save Image (dir)
  • images
    directory
    sub_directory
    filenames
    compress_level4

    ComfyUI's built-in Save Image writes into a fixed output/ folder with names like ComfyUI_00001_. That's fine until you're doing batch work and want images to land in a project folder with names you actually recognize. Save Image (dir) is the version that takes a directory path and a filename and writes exactly where and as what you tell it - PNG output, workflow metadata embedded, no surprises.

    It's an output node (nothing comes out of it; it's the end of a line). The required inputs are images (the IMAGE tensor from your VAE decode) and directory - an absolute path, not a relative one, which is the first thing people get wrong: the node does not resolve against ComfyUI's output/ folder, so output/my_folder won't behave the way you expect. Give it /home/you/projects/gen/my_folder (or the Windows equivalent).

    The optional inputs are where the power is:

    • sub_directory - a subfolder appended to directory, created automatically
    • filenames - a single name for a single image, or (from a list source) one name per image; leave empty and it numbers them 0, 1, 2...
    • compress_level - PNG compression 0–9, default 4 (the tooltip says it plainly: 0 = none, 9 = maximum). Bump it up if disk space matters more than write speed.

    Under the hood it's a reimplementation of core SaveImage with the path made explicit. It writes PNG text chunks - the prompt and workflow metadata the whole ecosystem relies on to reconstruct a graph by dragging the image back into ComfyUI (the image-io-metadata doc calls the workflow "the project file"). The one caveat: if you launched ComfyUI with --disable-metadata, this node respects that and writes plain PNGs, same as core SaveImage.

    Pairing it with the folder loaders

    This node is the natural bookend to Load Image Batch (dir) / Load Image List (dir): load a folder, batch-process it, save results to a different folder with the same filenames, and you've built a small image pipeline that never touches ComfyUI's default output location.

    Installing it

    No dependencies beyond ComfyUI's own, no models. ComfyUI Manager → ComfyUI-Prompt-Helper, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/elypha/ComfyUI-Prompt-Helper
    

    Restart. Despite the pack's name, this one sits in the image category, not prompt_helper.

    The tradeoff to know: directory and filenames are plain text boxes, so this node doesn't get a folder-picker UI - you type or wire your paths. If you want a click-through file dialog, core Save Image with a conversion trick is the comfort pick; if you want deterministic paths for automation, this is the one.

    Categoryimage

    Inputs (5)

    NameTypeDefaultDescription
    imagesIMAGE
    directorySTRING
    sub_directoryoptSTRING
    filenamesoptSTRING
    compress_leveloptINT40–9PNG compression level (0-9). 0 = no compression, 9 = maximum compression.

    Outputs (0)

    No outputs