ComfyUI Node

Image Saver

The saver that stuffs your prompt into EXIF so your gallery software shows it

By alessandroperilli·Created about a year ago·Updated 10 months ago· 4
Image Saver
  • images
  • FILENAME
  • FILE_PATH
filename%seed_%date_%time_final_OCS
path%date/
seed0
image_format
lossless_webptrue
jpg_webp_quality100
date_format%Y-%m-%d
time_format%H%M%S
EXIF_UserComment
embed_workflowtrue

ComfyUI's built-in saver is fine, but it buries your workflow in the PNG workflow chunk, which is invisible unless you drag the image back into ComfyUI. Image Saver does the thing you actually want when you're building a library of outputs: it writes your prompt and settings into the standard EXIF UserComment tag, so XnView MP, digiKam, or any EXIF-aware viewer shows you the recipe right next to the picture. No special software required.

It's part of the Open Creative Studio Nodes pack, and the README credits receyuki's SD Prompt Saver and willmiao's Save Image (LoraManager) as its lineage - both popular save nodes in their own right.

How it works

It's a proper output node (OUTPUT_NODE = True), meaning it doesn't feed anything downstream - it finishes the graph. For each image it: resolves the filename and folder from your tokens, saves the file in the format you chose, and - if you filled in EXIF_UserComment - writes that text into the EXIF UserComment tag (tag 0x9286, encoded UTF-16BE per the EXIF spec) using piexif. For PNG it can additionally embed the full workflow in the workflow metadata chunk, which is what keeps "drag back into ComfyUI" working.

The inputs that matter

  • images - required, the batch to save.
  • filename - the template. Supports %seed%, %date%, %time%, and %counter% (the counter is added automatically for batches). Default: %seed_%date_%time_final_OCS.
  • path - a subfolder under ComfyUI's output directory. Default %date/ means one folder per day, which is honestly the best default in the pack.
  • image_format - png, jpg, jpeg, or webp.
  • EXIF_UserComment - the multiline text (prompt, settings, whatever) that lands in the EXIF tag. The whole point of the node.
  • embed_workflow - embeds the complete workflow into the image metadata. One small honesty note: the tooltip says PNG and WebP, but the current code actually writes the workflow chunk for PNG only - WebP saves come out without it. If recoverable workflows matter, save PNG.
  • seed - used by %seed% in the filename; pass the actual seed so your filenames carry it.

It also exposes lossless_webp and jpg_webp_quality if you're compressing.

Outputs

FILENAME and FILE_PATH, both strings. Since it's an output node these mostly matter for logging or for feeding a "batch done" node, but they're there if you want to route the saved path elsewhere.

Install

ComfyUI Manager → "Open Creative Studio Nodes" → install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/alessandroperilli/OCS_Nodes

The pack declares no extra requirements - it uses PIL, piexif, and ComfyUI's own folder_paths, all of which ship with a standard install.

Where people get burned

  • EXIF silently does nothing if piexif is missing. The code wraps EXIF writing in a try/except and just prints an error, so a bare Python environment without piexif gives you no warning in the UI. If your files come out EXIF-free, check the console - that's usually the culprit.
  • JPG and workflow-embedding don't mix. embed_workflow writes the workflow chunk for PNG (and claims WebP, though the current code doesn't deliver it there). If you need both EXIF and a recoverable workflow, PNG is your format.
  • The EXIF tag is for humans, not ComfyUI. XnView MP will display it; ComfyUI won't restore the workflow from EXIF alone - that's what the embedded workflow chunk is for.
CategoryOCS Nodes

Inputs (11)

NameTypeDefaultDescription
imagesIMAGE
filenameoptSTRING%seed_%date_%time_final_OCS
pathoptSTRING%date/
seedoptINT00–18446744073709550000
image_formatoptCOMBO4 options: png, jpg, jpeg, webp
lossless_webpoptBOOLEANtrue
jpg_webp_qualityoptINT1001–100
date_formatoptSTRING%Y-%m-%d
time_formatoptSTRING%H%M%S
EXIF_UserCommentoptSTRING
embed_workflowoptBOOLEANtrueEmbeds the complete workflow data into the image metadata. Only works with PNG and WebP formats.

Outputs (2)

NameTypeDescription
FILENAMESTRING
FILE_PATHSTRING