Nodes/ComfyUI-IMGNR-Utils/Preview Image - Ad-hoc Save (IMGNR)
ComfyUI Node

Preview Image - Ad-hoc Save (IMGNR)

Preview now, save the good ones after — without re-running the workflow

By ImagineerNL·Created about a year ago·Updated 5 months ago· 21
Preview Image - Ad-hoc Save (IMGNR)
  • images
  • mask
  • image
  • mask
  • filename_prefix
  • counter_out
  • full_filename
filename_prefixComfyUI
counter1
add_countertrue
filename_extras
autosavefalse
embed_workflowtrue
overwritefalse

Standard ComfyUI forces a fork in the road: either you save everything (and wade through 400 near-identical PNGs to find the two you like) or you only preview (and re-run the whole workflow when you finally decide one is a keeper). Ad-hoc Save (IMGNR) is the third option, and it's quietly the most useful node in this pack.

It previews like a disposable node by default - nothing written to disk - but every preview carries a Save button. See a result you want? Click it, and the image is written to your output folder without re-running the generation. The preview's gone on reload, the saved file is permanent. The author's own use case, straight from his launch post: your upscaler or detailer pass produces a keeper, and you save just that one without paying for another full pipeline run.

How it works

On every execution the node caches the current prompt and workflow metadata against its node id, then renders the preview as base64 in the browser (same trick as the No Save sibling). Clicking Save fires a POST to a small API endpoint (/imgnr/save_manual) that decodes that cached image and writes it to your output folder - with full PNG workflow metadata embedded if embed_workflow is on, which is how "workflow included" sharing stays intact. Because the metadata was cached at generation time, the manual save works even outside the execution loop. That was a genuine bug early on (workflow metadata missing on manual save) and it's fixed.

The inputs that matter

  • filename_prefix - where and what to save. Defaults to ComfyUI, and it accepts ComfyUI's formatting variables: %date:yyyy-MM-dd%, or %Empty Latent Image.width% to pull values from other nodes. This was renamed from filename_main in v3.4.0, so old workflows referencing the old name will need a nudge.
  • counter + add_counter - the auto-numbering. This is the clever bit: the node exposes counter_out, so you can wire several Ad-hoc Save nodes together (original vs. upscaled) and keep them on the same index. The author's example gives you ComfyUI_00001 and ComfyUI_00001_SEEDVR instead of two counters drifting apart.
  • filename_extras - free text appended after the counter (no formatting applied, per the tooltip).
  • autosave - set true and the next run saves automatically, giving you one-shot "save this batch" behavior without hunting for a button.
  • overwrite - false by default; a name collision silently becomes _001, _002, so you never clobber an existing file.

Outputs are image and mask (pass-through), plus filename_prefix, counter_out (INT), and full_filename (STRING) - so downstream nodes can know exactly where the file landed.

Gotchas

The overwrite quirk can surprise you: with it off, repeated manual saves of the "same" file don't overwrite - they pile up as numbered variants. That's usually what you want, but if you're re-saving a fixed slot (like a portfolio cover), flip it on. And the filename_mainfilename_prefix rename in v3.4.0 is the kind of silent breaking change that makes loaded workflows fail to find a widget - check the changelog if a downloaded workflow uses this node.

Installing it

Zero dependencies, as with the rest of ComfyUI-IMGNR-Utils - the pyproject ships an empty dependency list, so there's nothing to pip and no models to fetch:

cd ComfyUI/custom_nodes
git clone https://github.com/ImagineerNL/ComfyUI-IMGNR-Utils

or search "ComfyUI-IMGNR-Utils" in ComfyUI Manager and restart. The node shows up under IMGNR alongside its No Save and Compare siblings. If you want the A/B-compare tools bolted on, use the Compare variant instead - same inputs, plus slider/blink comparison against your last generation.

CategoryIMGNR

Inputs (9)

NameTypeDefaultDescription
imagesIMAGE
filename_prefixSTRINGComfyUIThe prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes.
counterINT10–999999
add_counterBOOLEANtrue
filename_extrasSTRINGText to add after the counter.(no formatting)
autosaveBOOLEANfalse
embed_workflowBOOLEANtrue
overwriteBOOLEANfalse
maskoptMASK

Outputs (5)

NameTypeDescription
imageIMAGE
maskMASK
filename_prefixSTRING
counter_outINT
full_filenameSTRING