[!] Forked from https://github.com/giriss/comfy-image-saver, which seems to be inactive since a while.
Allows you to save images with their generation metadata. Includes the metadata compatible with Civitai geninfo auto-detection. Works with PNG, JPG, WEBP and AVIF. All formats store the a1111-style parameters and can embed the full workflow in comfy format (stable for PNG; for JPEG only if it fits the 64 KB EXIF limit). Includes hashes of Models, LoRAs and embeddings for proper resource linking on civitai.
You can find example workflows in the examples directory.
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:
This would have civitai autodetect all of the resources (assuming the model/lora/embedding hashes match):
If you have ComfyUI-Manager, you can simply search "ComfyUI Image Saver" and install these custom nodes.
If you don't have ComfyUI-Manager, then:
- Using CLI, go to the ComfyUI folder
cd custom_nodesgit clone git@github.com:alexopus/ComfyUI-Image-Saver.gitcd ComfyUI-Image-Saverpip install -r requirements.txt- Start/restart ComfyUI
Saving AVIF needs Pillow 11.2 or newer, built with AVIF support (the standard pip packages are). To check, run this with the Python that ComfyUI uses:
python -c "import PIL; from PIL import features; print(PIL.__version__, features.check('avif'))"
If it prints False, upgrade Pillow in that same environment, then restart ComfyUI:
| Setup | Command |
|---|---|
| Windows portable | python_embeded\python.exe -m pip install -U "pillow>=11.2" (from the ComfyUI_windows_portable folder) |
| venv / manual install | activate the venv, then python -m pip install -U "pillow>=11.2" |
Linux distribution packages of Pillow can lack AVIF support even when they are new enough; use a venv with Pillow from pip in that case. All other formats work with any Pillow version.
You can use following placeholders:
%date%time– format taken fromtime_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 becomes001)%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 |
Load Image with Metadata works like ComfyUI's Load Image (upload, preview, mask editor, image and mask outputs) and also reads the generation metadata stored in the file. Use it to keep the original prompt, settings and Civitai resources when saving an upscaled or otherwise processed version:
metadata→ connect to themetadatainput of Image Saver Simple. The original A1111 parameters are written unchanged; filename variables like%seeduse the original values.positive/negative→ the prompts, e.g. for a second sampling pass.
The node shows the metadata as soon as an image is selected, without running the workflow, as a table or as the raw text. Both can be copied.
To change parts of the metadata before saving, put Edit Metadata in between. Only what you change is rewritten in the A1111 parameters; hashes, Civitai resources and all other settings stay as they are, without hashing or Civitai lookups:
positive,negative,modelname:[original]keeps the text,[original], 4kappends, other text replaces it, empty text removes it (same as Edit Image Saver Pipe).seed,steps,cfg,width,height,denoise,clip_skip,sampler_name,scheduler_name: only change when connected, e.g. the size of the upscaled image or the denoise of a second pass.remove_settings: comma-separated settings to remove, e.g.Civitai resources, Hashes, Model hash.remove_resources: comma-separated resources to remove fromHashes,Civitai resourcesandLora hashes/TI hashes, by name (e.g.EasyNegative, or the Civitai name shown in the loader's table), hash, Civitai version ID or AIR. Useful after removing embeddings or LoRAs from a prompt; the model's hash stays.
It reads images saved by Image Saver, A1111/Forge and ComfyUI (PNG, JPEG, WebP, AVIF). For images saved by ComfyUI's own nodes, which store no A1111 parameters, prompts and settings are read from the embedded workflow on a best-effort basis, and the metadata output carries no parameters to write. Editing the image in the mask editor creates a copy without the original's metadata; the node warns about that.
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.
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.
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 unneces
664E
sary memory buildup.
For finer control in extremely large workflows, you can also use custom nodes that provide dedicated execution control.
- 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 Pipenode 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 Pipeto extract values for external manipulation before feeding them back into anEditnode. - Standard Dropdown Menus: Sampler and scheduler inputs use combo boxes, allowing for easier direct connection to other 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.
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.