ComfyUI Node

SaveImgAdv

Smaller images that still upload to CivitAI with the prompt attached

By jkrauss82·Created 3 years ago·Updated 7 months ago· 8
SaveImgAdv
  • images
    filename_prefixComfyUI
    mode
    formatwebp
    compression90
    calc_model_hashesfalse
    add_automatic1111_metafalse
    keywords

    ComfyUI's default Save Image writes lossless PNGs with the whole workflow embedded, which is great for drag-and-drop sharing and terrible for disk space - a batch of 1024px images chews through gigabytes fast. SaveImgAdv is the alternative: a save node that writes PNG, WebP, or JPEG, and - here's the trick - stamps the file with Automatic1111-style EXIF metadata and optional CivitAI model hashes so the sites that read A1111 metadata still see your prompt, settings, and models. It's a fork of Kaharos94's Saveaswebp that got heavily reworked, and it's the reason people point at the ULTools pack when someone asks how to move A1111 prompt data into ComfyUI.

    How it works

    For WebP and JPEG it embeds everything into EXIF: the workflow JSON, the prompt string, and - if you enable it - a reconstructed A1111 prompt block (positive, negative, sampler, steps, CFG, seed, denoise, model, LoRAs, ControlNet, hires upscaler) built by walking backwards through your node graph. That reconstruction is honest-to-god hacky, and the author says so in the README: it works for basic txt2img and "will surely break for more advanced workflows." For PNG it falls back to the standard ComfyUI metadata path, which is why PNG is the safe choice when you want perfect drag-and-drop workflow recovery.

    The other headline feature is model hashing. With calc_model_hashes on, it SHA256-hashes the checkpoints, LoRAs, and embeddings it finds in the graph, caches them in ComfyUI/models/hashes.json, and appends them to the A1111 metadata. That's what makes CivitAI auto-link your models to the right resource pages. First run is slow while it hashes every file once; after that it's cached.

    The inputs that matter

    • format - webp (default), jpg, or png. WebP is the sweet spot: lossy, small, keeps the metadata.
    • compression - 1 to 100. In lossy mode it's basically quality: higher = bigger file, less compression. In lossless mode (WebP) it's a speed/size tradeoff - 100 means smallest file, slower save. The slider label is a lie in both directions, so read it as "percent kept" and move on.
    • mode - lossy or lossless. JPEG ignores it (always lossy), PNG ignores it (always lossless).
    • filename_prefix - supports subfolders via slashes, and %width%/%height% placeholders. Files land as prefix_00001_.webp - note the trailing underscore, the counter logic depends on it.
    • calc_model_hashes - the CivitAI auto-linking feature above. Costs time on first run.
    • add_automatic1111_meta - writes the A1111 UserComment block that CivitAI parses.
    • keywords - free-text tags stored in the XPKeywords EXIF field; pairs nicely with WD14 tagger. Right-click the node and "convert keywords to input" if you want to wire them in.

    Gotchas

    JPEG EXIF caps out around 64KB, so with big workflows the node silently drops metadata (it warns in the console) until it fits. And a real known issue from the README: importing a WebP workflow can break if a node has dynamic wildcards disabled and the JSON contains }Prompt:{. For the version you upload to CivitAI, expect it to read the A1111 metadata rather than the full ComfyUI workflow - that's by design.

    Installing it

    This is one node in the ULTools for ComfyUI pack (jkrauss82/ultools-comfyui). ComfyUI Manager: search "ULTools for ComfyUI". Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jkrauss82/ultools-comfyui
    cd ultools-comfyui
    pip install -r requirements.txt   # pandas, numpy, piexif
    

    Restart ComfyUI. piexif is the real dependency here - it's what writes the EXIF. No models to download, and it's a hobby pack, so keep expectations about support proportional.

    If you upload to CivitAI or just hate watching your output folder balloon, this is the save node to reach for. Keep PNG in the workflow when you want drag-and-drop recovery, and use WebP for everything you actually keep or share.

    Categoryimage

    Inputs (8)

    NameTypeDefaultDescription
    imagesIMAGE
    filename_prefixSTRINGComfyUI
    modeCOMBO2 options: lossy, lossless
    formatCOMBOwebp3 options: webp, jpg, png
    compressionINT901–100
    calc_model_hashesBOOLEANfalse
    add_automatic1111_metaBOOLEANfalse
    keywordsSTRING

    Outputs (0)

    No outputs