Extensions/ComfyUI Image Saver
ComfyUI Extension Runs on cloud

ComfyUI Image Saver

Allows you to save images with their generation metadata compatible with Civitai. Works with png, jpeg and webp. Stores LoRAs, models and embeddings hashes for resource…

By alexopus·Created 3 years ago·Updated 22 days ago· 190
alexopus/ComfyUI-Image-Saver
Nodes31
On cloudRunnable
CategoryImageSaver/utils, CivitaiAPI
Stars190
Updated22 days ago

Nodes (31)

Any to String (Image Saver)

Turn any wire into text so it can land in your metadata

ImageSaver/utils
Cfg Literal (Image Saver)

Define your CFG once so the sampler and the metadata agree

ImageSaver/utils
Checkpoint Loader with Name (Image Saver)

A normal loader that also hands you the filename

ImageSaver/utils
Civitai Hash Fetcher (Image Saver)

Pull a model's hash live so shared workflows self-link

CivitaiAPI
Conditioning Concat Optional (Image Saver)

Merge two conditionings, or pass one straight through

conditioning
Edit Image Saver Pipe

Branch and override saver settings mid-workflow

ImageSaver/Pipe
Empty Latent (Image Saver)

Pick a canvas by aspect ratio and size tier

ImageSaver/utils
Float Literal (Image Saver)

A decimal-number source for denoise, weights and the like

ImageSaver/utils
Image Saver

Save your images with prompt + Civitai-ready metadata baked in

ImageSaver
Image Saver (From Pipe)

The node that actually writes the file

ImageSaver/Pipe
Image Saver Metadata

Build the generation info once, save it anywhere

ImageSaver
Image Saver Simple

The file-saving half, fed by a separate metadata node

ImageSaver
Input Parameters (Image Saver)

One node that feeds seed, steps, CFG, sampler + scheduler to both sides

ImageSaver/utils
Int Literal (Image Saver)

A plain integer source for steps and other whole-number inputs

ImageSaver/utils
Make Image Saver Metadata Config

The CivitAI-readable generation data

ImageSaver/Pipe
Make Image Saver Pipe

Bundle saver + metadata into one wire

ImageSaver/Pipe
Make Image Saver Simple Config

Filenames, folders and file type in one node

ImageSaver/Pipe
Random Artist Picker (Image Saver)

Roll random artist style tags from a list

utils
Random Character Picker (Image Saver)

Roll random danbooru-style character tags into a prompt

utils
RandomShapeGenerator

Throwaway test images without spinning up a model

image/generators
Random Tag Picker (Image Saver)

Shuffle random tags into your prompt

utils
Read Image Saver Pipe

Unpack a pipe's values without triggering hashing

ImageSaver/Pipe
Sampler Selector (Image Saver)

Pick a sampler once, get both the value and its name

ImageSaver/utils
Scheduler Selector (Eff.) (Image Saver)

Expose the Efficiency-pack schedulers, name included

ImageSaver/utils
Scheduler Selector (Image Saver)

Pick a scheduler once, get enum + name

ImageSaver/utils
Scheduler Selector (inspire) (Image Saver)

The Inspire-pack scheduler list, with a name output

ImageSaver/utils
Seed Generator (Image Saver)

One seed for the sampler and the metadata, with an offset knob

ImageSaver/utils
String Literal (Image Saver)

A reusable text box for prompts you want in two places at once

ImageSaver/utils
UNet loader with Name (Image Saver)

Load a Flux-style diffusion model and keep its filename

ImageSaver/utils
Width/Height Literal (Image Saver)

A size source that steps in 8s, so the metadata matches

ImageSaver/utils
Workflow Input Value (Image Saver)

Pull a value out of another node by its ID

ImageSaver/utils
Readme

[!] Forked from https://github.com/giriss/comfy-image-saver, which seems to be inactive since a while.

Save image with generation metadata in ComfyUI

Allows you to save images with their generation metadata. Includes the metadata compatible with Civitai geninfo auto-detection. Works with PNG, JPG and WEBP. For PNG stores both the full workflow in comfy format, plus a1111-style parameters. For JPEG/WEBP only the a1111-style parameters are stored. Includes hashes of Models, LoRAs and embeddings for proper resource linking on civitai.

You can find example workflows in the examples directory. <img width="1288" height="1039" alt="workflow" src="https://github.com/user-attachments/assets/dbbb9f67-afa3-48a2-8cd3-e4116393f8e0" />

You can also add LoRAs to the prompt in <lora:name:weight> format, which would be translated into hashes and stored together with the metadata. For this it is recommended to use ImpactWildcardEncode from the fantastic ComfyUI-Impact-Pack. It will allow you to convert the LoRAs directly to proper conditioning without having to worry about avoiding/concatenating lora strings, which have no effect in standard conditioning nodes. Here is an example: workflow

This would have civitai autodetect all of the resources (assuming the model/lora/embedding hashes match): image

How to install?

Method 1: Manager (Recommended)

If you have ComfyUI-Manager, you can simply search "ComfyUI Image Saver" and install these custom nodes.

Method 2: Easy

If you don't have ComfyUI-Manager, then:

  • Using CLI, go to the ComfyUI folder
  • cd custom_nodes
  • git clone [email protected]:alexopus/ComfyUI-Image-Saver.git
  • cd ComfyUI-Image-Saver
  • pip install -r requirements.txt
  • Start/restart ComfyUI

Customization of file/folder names

You can use following placeholders:

  • %date
  • %time – format taken from time_format
  • %time_format<format> – custom datetime format using Python strftime codes
  • %model – full name of model file
  • %basemodelname – name of model (without file extension)
  • %seed
  • %counter
  • %counter<padding> – zero-padded counter (e.g. %counter<03> with counter 1 becomes 001)
  • %sampler_name
  • %scheduler
  • %steps
  • %cfg
  • %denoise

Example:

| filename value | Result file name | | --- | --- | | %time-%basemodelname-%cfg-%steps-%sampler_name-%scheduler-%seed | 2023-11-16-131331-Anything-v4.5-pruned-mergedVae-7.0-25-dpm_2-normal-1_01.png | | %time_format<%Y%m%d_%H%M%S>-%seed | 20231116_131331-1.png | | %time_format<%B %d, %Y> %basemodelname | November 16, 2023 Anything-v4.5.png | | img_%time_format<%Y-%m-%d>_%seed | img_2023-11-16_1.png |

Common strftime format codes for %time_format<format>:

| Code | Meaning | Example | |------|---------|---------| | %Y | Year (4-digit) | 2023 | | %y | Year (2-digit) | 23 | | %m | Month (01-12) | 11 | | %B | Month name (full) | November | | %b | Month name (short) | Nov | | %d | Day (01-31) | 16 | | %H | Hour 24h | 13 | | %I | Hour 12h | 01 | | %M | Minute | 13 | | %S | Second | 31 | | %p | AM/PM | PM | | %A | Weekday (full) | Thursday | | %a | Weekday (short) | Thu | | %F | YYYY-MM-DD | 2023-11-16 | | %T | HH:MM:SS | 13:13:31 |

Optional: Pipe Integration (Advanced Orchestration)

For orchestrating complicated workflows—such as projects involving dozens of character scenarios each with multiple scenes—the standard wiring can become dense. To help manage this, an optional Pipe system is available.

The pipe system bundles all metadata and image saver settings into a single connection, allowing you to pass them through a workflow and branch them efficiently.

When Should I Need Pipe?

In most cases, the standard ImageSaverMetadata, ImageSaverSimple, or ImageSaver nodes are recommended, as the core features are identical.

The Pipe system is primarily beneficial when your workflow becomes crowded with wires between KSamplers and metadata nodes. It acts as an orchestrator, helping you maintain a cleaner generation pipeline in complex, multi-stage environments.

Image Saver Pipe Workflow

Execution Order Observations (For Large Workflows)

Depending on your wiring strategy, ComfyUI may execute multiple KSamplers across the graph before reaching the corresponding ImageSaverFromPipe nodes. To optimize this, ensure that the branch containing an ImageSaverFromPipe node does not depend on resources from other active branches. This helps ComfyUI complete each branch sequentially, preventing unnecessary memory buildup.

For finer control in extremely large workflows, you can also use custom nodes that provide dedicated execution control.

Features

  • Simplified Wiring: Carries generation and saver settings in one pipe connection, useful for large-scale orchestration.
  • Deferred Execution: Expensive operations like checkpoint hashing and Civitai API lookups are deferred until the final save operation.
  • Non-destructive Editing: The Edit Image Saver Pipe node allows you to branch and modify settings. All string fields support the [original] placeholder (e.g., [original], masterpiece) to easily append or prepend text.
  • Orchestration Support: Use the Read Image Saver Pipe to extract values for external manipulation before feeding them back into an Edit node.
  • Standard Dropdown Menus: Sampler and scheduler inputs use combo boxes, allowing for easier direct connection to other nodes.

Included Nodes

  • Make Image Saver Simple Config: Standalone configuration for filename, path, and file type.
  • Make Image Saver Metadata Config: Standalone configuration for prompts and generation parameters.
  • Make Image Saver Pipe: Bundles the above configurations into a single pipe connection.
  • Edit Image Saver Pipe: Overrides settings in an existing pipe (creates a new branch).
  • Read Image Saver Pipe: Extracts settings from a pipe for inspection or external use.
  • Image Saver (From Pipe): Unpacks the pipe settings and saves the image.

Workflow Consistency

The pipe system uses the same underlying logic as the standard nodes but is designed for a different workflow style.

  • Compatibility: Standard nodes and pipe nodes have different input/output structures and are not directly interchangeable.
  • Execution Timing: It is recommended to use one system consistently within a specific workflow branch. Standard nodes trigger side-effects (like metadata lookups) immediately upon execution. In contrast, pipe nodes defer these actions until the final saving step, allowing you to update metadata properties at multiple stages of your workflow before they are committed to disk.