Nodes/SmartSave/Smart Save (Image)
ComfyUI Node

Smart Save (Image)

Stop guessing where your images land — Smart Save Image shows you before you queue

By phibbyrizz·Created 29 days ago·Updated 10 days ago· 4
Smart Save (Image)
  • images
    ◄filename_prefixauto►
    ◄save_raw_pngtrue►
    ◄save_compressed_jpgtrue►
    ◄jpg_quality90►
    ◄positive_prompt►
    ◄subfolder►
    ◄ollama_modelllama3.2:3b►

    Every ComfyUI save node has the same flaw: you type a filename rule, queue the run, and then go spelunking through output/ to find out where the thing actually went. Smart Save Image (class SmartSaveImage, from the yurishk/ComfyUl-SaveImage pack) is the one that fixes that - it previews the real destination folder and an example filename before you queue, right on the node.

    That preview is the whole pitch, and it's not a gimmick. The node ships a small backend endpoint (/smartsave/preview) plus custom frontend that run the exact same template logic used at save time. As you type in the folder or filename rule, it sends your current workflow graph to that endpoint and gets back the resolved path, whether the folder already exists, how many images are in it, and what the next files would actually be called. You see output/krea/sdxl_base_1.0/image_00042.png with a "directory does not exist yet" note before you've burned a single GPU second.

    What makes it work is the model-reading. Rather than assuming your loader's input is named ckpt_name (a lot of save nodes hardcode that and silently break on third-party loaders), it scans the whole prompt graph for checkpoint, UNet, LoRA, VAE, seed, steps, CFG, sampler, and prompt values with a pile of fallback keys and a class-name check (CheckpointLoader-ish nodes get a second pass). It even falls back to EmptyLatentImage dimensions when there's no real image to measure. Everything gets sanitized - invalid filename characters become _, Windows reserved names like CON get an underscore, and only literal slashes you type create subfolders, so a model name containing / can't explode your directory tree.

    The inputs that actually matter

    • images - the batch to save. This is your only required wire.
    • folder_template / filename_template - the rules. Defaults are %date:yyyy-MM-dd%/%model% and %model%_%seed%. Tokens cover date/time, %model%, %model_full%, %unet%, %lora%/%loras%, %vae%, %seed%, %steps%, %cfg%, %sampler%, %scheduler%, %width%, %height%, %prompt%, %negative%, %batch%, plus custom ones you define.
    • root_mode + custom_root - output (default), input, temp, or custom for an absolute/relative path. Leave custom_root blank and it falls back to output.
    • collision_mode - increment auto-numbers to avoid overwriting; overwrite clobbers same-named files.
    • save_mode - save_and_preview (default), save_only, or preview_only (delegates to the core Preview Image node for throwaway runs).

    Worth knowing: quality exists in the schema but is a legacy field - it's hidden in the new UI. The ones you actually tweak are png_compression (0–9, default 4 to match ComfyUI's built-in save) and counter_digits (how many digits the batch suffix uses). embed_workflow toggles metadata, and manual_model or a wired model_input overrides the auto-detected model name.

    One real take

    Smart Save writes a ComfyUI-native prompt/workflow chunk into PNGs and an A1111-style parameters text block. That's the flat string CivitAI's uploader keys on for auto-linking your model and LoRAs - the exact reason the KB essay "Stop using ComfyUI's default Save Image node (if you post to Civitai)" exists. JPEG/WebP can't hold the node graph; those get the parameters in EXIF instead, which is the best you can do outside PNG.

    Install and gotchas

    No models, no heavy deps - requirements are just Pillow and NumPy, both already in ComfyUI. Install "smart-save-image" from ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yurishk/ComfyUl-SaveImage
    

    then restart ComfyUI. Where people get burned: the target folder isn't created until the first save, so "does not exist yet" in the preview is normal. If you save to an absolute path outside output/input/temp, ComfyUI can't serve a direct preview and the node falls back to a temp preview - the file is still where you told it to be. And if you run with --disable-metadata, the embedding is silently skipped, because the node respects that global flag. One more: the pack's UI is bilingual (English/Simplified Chinese), the author is a solo dev, and this is genuinely a niche utility - but for organized output it's the nicest version of this problem I've found.

    Categoryimage/saving

    Inputs (8)

    NameTypeDefaultDescription
    imagesIMAGE—
    filename_prefixSTRINGauto—
    save_raw_pngBOOLEANtrue—
    save_compressed_jpgBOOLEANtrue—
    jpg_qualityINT901–100—
    positive_promptoptSTRING—
    subfolderoptSTRING—
    ollama_modeloptSTRINGllama3.2:3b—

    Outputs (0)

    No outputs