Nodes/ComfyUI-Flow-Control/Flow - Save Image
ComfyUI Node

Flow - Save Image

The save node that writes metadata CivitAI actually reads

By krich-cto·Created 2 years ago·Updated 2 years ago· 1
Flow - Save Image
  • images
  • gen_info
  • images
  • files
path
filename%date_%model_%counter
extension
counter_digits4
time_format%Y-%m-%d-%H%M%S
dpi300
quality100
optimizefalse
webp_losslesstrue
workflow_embeddedtrue
show_previewstrue

If you've ever uploaded a ComfyUI render to CivitAI and watched it come back with "unknown sampler" or no model hash, you know the pain this node is fixing. FlowSaveImage is a replacement save node that writes the metadata the way the A1111 generation parameters convention expects: a parameters text chunk with prompts, steps, sampler, CFG, seed, size, model hash and hashes for every LoRA and embedding. Drag a saved file onto CivitAI's site and it actually resolves the model, LoRAs and sampler name instead of shrugging.

It's the terminal node of ComfyUI-Flow-Control, and it's the one part of the pack you can bolt onto a plain workflow without committing to the rest. The catch is the metadata: it only has anything to write if you feed it the gen_info input, and that dict is produced by the pack's own loaders and sampler. Feed it gen_info and the save becomes informative; skip it and you get a very capable plain save node with empty metadata.

How it works

Give it images, and it writes each one to disk. The filename is a template, and the token system is the standout feature. %date, %time, %counter, %model, %seed, %steps, %guidance, %cfg, %sampler_name, %scheduler and %denoise all expand. The %counter is smart - it scans the target directory for existing files matching your pattern and picks up at the next number, with counter_digits controlling zero-padding (default 4).

When gen_info is present, it assembles an A1111-style parameter string: the positive prompt, a Negative prompt: line, then Steps: ..., Sampler: ..., CFG scale: ..., Clip skip: ..., Seed: ..., Size: ..., Model hash: ..., Model: ..., Hashes: .... The sampler names get mapped to the CivitAI spellings ("euler_ancestral" becomes "Euler a", and a karras scheduler becomes "Euler a Karras"), which is the detail that makes uploaded images resolve cleanly. It also hashes every LoRA and embedding: in the prompts and stuffs them into the Hashes field.

Formats cover png, jpg, jpeg, gif, tiff, webp and bmp. PNGs get the workflow and prompt embedded as text chunks (toggle via workflow_embedded); jpg/webp/tiff use EXIF tags instead. quality, optimize, webp_lossless and dpi (default 300) are passed straight to PIL. show_previews copies a flow_preview_N file into the output directory so the browser preview works.

The inputs that matter

You'll realistically touch four things:

  • filename - your template, e.g. %date/%model_%seed or %model_%counter
  • path - a subfolder under your output dir (or an absolute path, or ~/...)
  • extension - whatever you're posting to, png for CivitAI, jpg/webp for smaller files
  • gen_info - optional, but this is where the metadata magic comes from

Outputs are images (the passthrough batch) and files (a list of absolute paths written, handy if you want to chain something onto the saved file).

Install

Install once for the whole pack - FlowSaveImage ships inside ComfyUI-Flow-Control:

cd ComfyUI/custom_nodes
git clone https://github.com/krich-cto/ComfyUI-Flow-Control
# if the pack won't load: pip install requests gguf

Restart ComfyUI. Or just use ComfyUI Manager and search "ComfyUI-Flow-Control". No model files are bundled; the pack expects the requests library for its CivitAI calls and imports the gguf Python package at startup, so if either is missing the whole pack fails to register.

Gotchas

The metadata only appears when gen_info is flowing through - wire a stock Checkpoint Loader into this and your "Parameters" text will be empty. That's the whole reason the pack's loaders, text encoder and sampler exist as a chain. Also, the counter logic assumes you didn't reuse the same file, so it checks existence and increments. And %model etc. come out blank without gen_info, which turns %model_%counter into something like _0001 - not a bug, just a reminder that this node wants the full Flow pipe to shine.

CategoryFlow/outputs

Inputs (13)

NameTypeDefaultDescription
imagesIMAGE
pathSTRING
filenameSTRING%date_%model_%counter
extensionCOMBO7 options: png, jpg, jpeg, gif, tiff, webp, +1
counter_digitsINT40–18446744073709550000
time_formatSTRING%Y-%m-%d-%H%M%S
dpiINT3001–2400
qualityINT1001–100
optimizeBOOLEANfalse
webp_losslessBOOLEANtrue
workflow_embeddedBOOLEANtrue
show_previewsBOOLEANtrue
gen_infooptGENINFO

Outputs (2)

NameTypeDescription
imagesIMAGE
filesSTRING