Nodes/ComfyUI_LC123_nodes/LC Last Image Holder
ComfyUI Node

LC Last Image Holder

Hold the last render so you can compare without re-running

By lonecatone23·Created 2 months ago·Updated about 13 hours ago· 19
LC Last Image Holder
  • new_image
  • held image
modehold previous generation

Every time you tweak a prompt, the sampler eats the previous image and spits out a new one. For A/B comparing "before I changed the seed" against "after," that's a problem: the old image is gone unless you saved it. LC Last Image Holder is the memory you were missing - it keeps the last image it saw and hands it back to you as a first-class output, even after you unplug it or the queue has moved on.

How it works

Feed it new_image (the current generation). It stores that image to a temp file keyed by the node's ID and hands you the previous one out of held image. Pick a mode:

  • hold previous generation (default): each run outputs the image from the last run, then stores the current one for next time. Perfect for "this is what I just had" comparisons.
  • hold until cleared: stores the first image it sees and freezes - the same image comes out forever until you hit the Clear button on the node.

The node displays the held image on its face at all times once something's stored, and it keeps it even if new_image is disconnected or empty - which is the whole trick. The held state survives a disconnect, and Clear empties memory without re-running the workflow (it calls a small API route rather than reprocessing anything).

Why this beats a screenshot

Two reasons. First, it's a real IMAGE output, so it wires straight into a comparer, an image split, or a save node - the before image participates in the graph instead of living in your Downloads folder. Second, it guards against double-execution in a single queue, so the hold doesn't get clobbered when a downstream node (like a batch comparer) forces extra passes. For a before/after wipe setup, this node plus LC Image Split is the two-node version of a workflow people usually bolt together out of four.

The few things to know

  • The temp file is one per node ID and gets overwritten - no buildup of junk.
  • "Hold previous" mode means the very first run has nothing to output (nothing was stored yet), so expect an empty-ish first pass.
  • Clear is a button on the node, not a widget value you wire. It's a UI action.

Install

Ships in ComfyUI LC123 Nodes (MIT, 89 nodes). ComfyUI Manager → search "ComfyUI LC123 Nodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes

Restart. No extra pip packages. On cloud hosts like RunningHub, request the pack and they install it for you.

When it's the wrong tool

If you just want a gallery of everything ever generated, this isn't it - it holds one image, by design. And if your workflow always saves every output anyway, the holder is redundant. But for the classic "same prompt, new seed - was the last one better?" loop, it's the node that finally gives you a memory to compare against.

CategoryLC123/image

Inputs (2)

NameTypeDefaultDescription
modeCOMBOhold previous generationhold previous generation: every generation outputs the previous image, then stores the current one. hold until cleared: stores the first image and freezes until you press Clear.
new_imageoptIMAGEOptional. Current generation to store. The node keeps and displays the held image even when this input is disconnected or empty.

Outputs (1)

NameTypeDescription
held imageIMAGE