Nodes/ComfyUI-Lora-Manager/Save Image (LoraManager)
ComfyUI Node

Save Image (LoraManager)

Save with CivitAI-readable metadata and pattern filenames

By willmiao·Created 2 years ago·Updated 21 days ago· 1,301
Save Image (LoraManager)
  • images
  • images
filename_prefixComfyUI
file_format
lossless_webpfalse
quality100
embed_workflowfalse
save_with_metadatatrue
add_counter_to_filenametrue
save_as_recipefalse

ComfyUI's stock Save Image node embeds the whole workflow graph into the PNG, which is great for reopening it and useless if you want the generation parameters in a form other tools can read. Save Image (LoraManager) fixes that: it writes A1111/CivitAI-style generation metadata - model, prompt, seed, the works - into the file, so your images carry their recipe the way a CivitAI download does. It's built on the same idea as ComfyUI-SaveImageWithMetaData, which the README credits.

The other half of what it's good for is filenames. It supports a full pattern-code system, so instead of ComfyUI_00042.png you get names that actually tell you what the image is - and it'll build subfolders for you while it's at it.

How it works

Feed it the images out of your VAE decode. It writes them in your chosen format with metadata embedded, naming each file per the filename_prefix pattern. Those patterns are the fun part: %seed%, %width%, %height%, %model:N% (checkpoint name, trimmed to N chars), %pprompt:N% / %nprompt:N% (positive/negative prompt), and %date:yyyy-MM-dd% style date codes. You can also pull any widget from any node - %KSampler.seed%, %Empty Latent Image.width% - and a / in the prefix makes a subdirectory, so %date:yyyy-MM-dd%/%seed% files things into dated folders automatically.

Inputs and outputs that matter

Required:

  • images (IMAGE) - what to save.
  • filename_prefix (STRING, default ComfyUI) - plain text or a pattern like %model:10%_%seed%.
  • file_format (enum: png / jpeg / webp).

The optional ones worth knowing: save_with_metadata (default true - the whole reason to use this node; leave it on), quality (1–100, for jpeg/webp), lossless_webp, embed_workflow (default false - turn on if you also want the reopenable graph baked in), add_counter_to_filename (default true), and save_as_recipe (default false - save the generation as a reusable recipe in the manager). It also passes the images straight through as an output so you can chain a preview after it.

How to install it

Via ComfyUI Manager: search lora-manager, Install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/willmiao/ComfyUI-Lora-Manager.git
cd ComfyUI-Lora-Manager
pip install -r requirements.txt

then restart. Light Python install.

Common issues & troubleshooting

Metadata isn't showing up in CivitAI / another tool. Confirm save_with_metadata is on (it's the default, but easy to switch off by accident). Metadata embeds cleanly in PNG; some viewers strip it from JPEG/WebP on re-save, so PNG is the safe bet if a downstream tool needs to read it.

A %Node.widget% placeholder came out blank. Cross-node placeholders match by the node's "Node name for S&R" property, then its title. If the reference doesn't resolve, rename the target node to match, or check the widget name is spelled exactly.

Files aren't where I expect. Subdirectories from a / in the prefix are created relative to your ComfyUI output directory. Characters that are illegal in folder names get replaced with underscores, which can make a path look different from what you typed.

CategoryLora Manager/utils

Inputs (9)

NameTypeDefaultDescription
imagesIMAGE
filename_prefixSTRINGComfyUIBase filename for saved images. Supports format patterns like %seed%, %width%, %height%, %model%, 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. Results in larger files but no quality loss.
qualityoptINT1001–100Compression quality for JPEG and lossy WebP formats (1-100). Higher values mean better quality but larger files.
embed_workflowoptBOOLEANfalseEmbeds the complete workflow data into the image metadata. Only works with PNG and WebP formats.
save_with_metadataoptBOOLEANtrueWhen enabled, embeds generation parameters into the saved image metadata. Disable to skip writing generation metadata.
add_counter_to_filenameoptBOOLEANtrueAdds an incremental counter to filenames to prevent overwriting previous images.
save_as_recipeoptBOOLEANfalseAlso saves each generated image as a LoRA Manager recipe.

Outputs (1)

NameTypeDescription
imagesIMAGE