Nodes/ComfyUI-IMGNR-Utils/Preview Compare LastGen (IMGNR)
ComfyUI Node

Preview Compare LastGen (IMGNR)

Slide-compare a generation against the last one, without babysitting your history

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

Tuning a seed, a prompt, or a CFG is a game of "was that one better or the one before?" Most people answer by toggling back and forth in their image history or mentally comparing two tabs. Preview Compare LastGen (IMGNR) answers it on the canvas: it's the Ad-hoc Save node with an always-on A/B comparison against your previous generation built into the same node body.

So it does double duty. It previews disposable and offers the click-to-save behavior from its sibling - same inputs, same outputs, same manual-save API. But the headline feature is the comparison drawer: a slider that wipes between the current image and the previous run, a blink button for an at-a-glance flick between the two, and a metadata diff that highlights what actually changed in the workflow between runs. That last bit is the sneaky-useful one. When you tweak three settings and can't remember which one moved the image, the diff shows you the exact widget values that changed.

How it works

The mechanics are the Ad-hoc Save node's: the image is base64'd to the browser, the prompt and workflow metadata are cached per node id at generation time, and a manual Save posts back to /imgnr/save_manual to write a keeper to your output folder with workflow metadata embedded. On top of that, the JS keeps a reference to the previous run's image and metadata. The slider clips between the two cached images, the blink button toggles them, and the diff box compares the cached prompt/metadata objects and lists what's different.

The comparison is per-node, which is the right design choice: it compares this node's last two runs, not the whole graph's history. You can drop several of these into one workflow - one on the raw generation, one after the upscaler - and each compares its own last two outputs. That's genuinely more useful than a global history view for A/B-ing a specific stage.

The inputs that matter

Identical to Ad-hoc Save, which is good news if you've used that node:

  • filename_prefix - the save path/prefix; supports %date:yyyy-MM-dd% and %NodeName.widget% formatting.
  • counter / add_counter / filename_extras - the numbering controls, with counter_out letting multiple save nodes share one index.
  • autosave - true auto-saves the next run.
  • embed_workflow - keep PNG workflow metadata on saved files (default on).
  • overwrite - off by default, so name collisions become _001, _002 instead of clobbering.

Outputs are the same five: image, mask, filename_prefix, counter_out, and full_filename. The compare tools are pure UI - they don't touch the data flow, so this slot in your graph behaves exactly like the plain Ad-hoc Save node.

Should you use this or the plain one?

If you never tweak-and-compare, the extra drawer is dead weight - the Ad-hoc Save node is leaner. But if you live on seed hunting, this replaces your "find the last two in history and squint" routine with a slider you can drag on the node itself. It's the one I'd reach for in a detailer or upscaler branch, where each run is expensive enough that eyeballing the delta matters.

Installing it

Same zero-dependency install as the rest of the pack - nothing to pip, no models:

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

or search "ComfyUI-IMGNR-Utils" in ComfyUI Manager and restart. You'll find it under IMGNR. Like the rest of the pack it's a single hobbyist maintainer's work - expect it to be solid but don't expect weekly updates.

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