Nodes/comfyui_TomMiniNodes/Save Image (TomMiniNodes)
ComfyUI Node

Save Image (TomMiniNodes)

A format-switching save node built for CivitAI-style metadata

By ThomasTechArtist·Created 6 months ago·Updated 6 months ago· 0
Save Image (TomMiniNodes)
  • images
  • images
filename_prefixComfyUI
file_format
lossless_webpfalse
quality100
embed_workflowfalse
save_json_sidecarfalse
add_counter_to_filenametrue

TomSaveImage is a drop-in replacement for ComfyUI's built-in SaveImage that adds what the stock node refuses to do: pick your output format (PNG, JPEG, or WebP), tune quality, template filenames with real tokens, and - its headline feature - write the other metadata dialect. Where the default node embeds the node graph as workflow/prompt text chunks, this one writes an A1111-style parameters block: prompt, Negative prompt:, then Steps:, Sampler:, Seed:, Model hash: on one line. That's the format CivitAI's uploader auto-detects to link the checkpoint and LoRAs by hash - which is why articles exist telling people to stop using ComfyUI's default save node when they post to CivitAI. This node is aimed squarely at that use case.

It comes from comfyui_TomMiniNodes, a tiny pack by Thomas Smith that currently exposes just this one node, in the Lora Manager/utils category. The folder structure - services/, recipes/, a metadata_collector/ with a CivitAI client and LoRA scanners - tells you it's a slice of a bigger LoRA-manager app, not a standalone project. The "Mini" is doing a lot of work right now.

How it works

The save itself is straightforward: it takes your IMAGE tensor, converts it to PIL, and writes it into ComfyUI's output/ folder with a counter appended (mypic_00001.png). Three format paths, each with a different metadata home - the parameters string goes into a PNG text chunk, or into the EXIF UserComment for JPEG/WebP. Flip embed_workflow on and the JSON workflow rides along too (PNG text chunk, or ImageDescription in WebP). Set save_json_sidecar and you also get a .json next to each image with the collected metadata plus the workflow - handy if you're scripting an archive.

The clever part is the metadata pipeline behind it. The pack installs hooks into ComfyUI's execution to watch what actually ran - which checkpoint, which sampler, which seed - then formats that into the A1111-style block, resolving model and LoRA hashes through its scanner services. And it's a pass-through: unlike the stock node, it returns the same images tensor it received, so you can drop it mid-graph, save a checkpoint copy, and keep the pixels flowing to a preview or an upscaler.

The inputs that matter

Only a couple you'll actually touch:

  • filename_prefix - the one to play with. The tooltip lists the tokens: %seed%, %width%, %height%, %model%, %date%, plus %pprompt:32% to truncate your prompt into the filename and the %model:20% / %date:yyyy-MM-dd_hhmmss% style with a length or format. Slash in the prefix (portraits/run_a) makes a subfolder, same as stock.
  • file_format - png, jpeg, or webp. PNG is your master copy; JPEG/WebP are for sharing, and the KB's rule applies: anything but PNG can't carry the graph back into ComfyUI.
  • quality - 1–100, default 100. Only applies to JPEG and lossy WebP. lossless_webp switches WebP to lossless.

Outputs: one images socket, which is your input passed through untouched.

Install

The README is a stub - it literally still contains template text about "add a basic requirements.txt" - so treat the install as the standard playbook:

cd ComfyUI/custom_nodes
git clone https://github.com/ThomasTechArtist/comfyui_TomMiniNodes

Then restart ComfyUI. Or in ComfyUI Manager, search for comfyui_TomMiniNodes. No model downloads, and requirements.txt is empty - the only non-Pillow import is piexif, which ComfyUI core already ships, so nothing extra to install.

The honest gotcha

Read this before you trust the metadata, because it's the difference between the node doing its job and doing its headline job. The collector that fills in Steps/Sampler/Seed/Model hash is never initialized in the shipped code: nothing calls its init(), and its standalone_mode check reads the HF_HUB_DISABLE_TELEMETRY env var in a way that defaults to collection-off on a stock install. The hash lookups need the pack's scanner services registered, which only happens when the larger LoRA-manager app is running. So today you get a clean save with your prompt in the parameters chunk - arguably a big JSON blob of the graph rather than the tidy block the formatter is built to produce - and the Steps:/Seed:/hash lines mostly won't appear. Nothing crashes; every lookup is wrapped in try/except and just skips. This is a young pack (one commit, zero community footprint - I searched, there's nothing on Reddit), so treat it as "check your output PNG in a metadata viewer before you rely on it," not a dealbreaker. The machinery is all there and correct; it just needs the author to wire the collector in.

Also note: the stock SaveImage embeds the workflow by default, so dragging a saved PNG back onto the canvas rebuilds your graph. Here that only works if embed_workflow is on - otherwise the PNG carries parameters (which CivitAI and A1111's PNG Info read) but not the graph ComfyUI reconstructs from. Turn it on before you close the tab on your only copy.

CategoryLora Manager/utils

Inputs (8)

NameTypeDefaultDescription
imagesIMAGE
filename_prefixSTRINGComfyUIBase filename for saved images. Supports format patterns like %seed%, %width%, %height%, %model%, %date%, %pprompt:32%, etc.
file_formatCOMBOImage format to save as. PNG preserves quality, JPEG is smaller, WebP balances size and quality.
lossless_webpoptBOOLEANfalseWhen enabled, saves WebP images with lossless compression.
qualityoptINT1001–100Compression quality for JPEG and lossy WebP formats (1-100).
embed_workflowoptBOOLEANfalseEmbeds workflow data into image metadata when supported.
save_json_sidecaroptBOOLEANfalseSaves a .json sidecar next to each image with collected metadata.
add_counter_to_filenameoptBOOLEANtrueAdds an incremental counter to filenames to prevent overwriting.

Outputs (1)

NameTypeDescription
imagesIMAGE