Nodes/ComfyUI TK3R Extensions/TK3R Image Compare
ComfyUI Node

TK3R Image Compare

A before/after slider for your own last generation

By TK3R·Created 7 months ago·Updated 7 months ago· 2
TK3R Image Compare
  • image
  • current
  • previous

When you're iterating on a prompt, the most useful comparison isn't against some reference image - it's against the last thing you generated. Same seed, one word changed, which of the two is better? TK3R Image Compare is a two-line node that makes that trivial: it caches the previous image it received and hands you both the current and the previous one, ready to drop into a comparison viewer.

The author uses it with rgthree's Image Comparer, and that's exactly the right pairing. rgthree's comparer gives you the A/B slider, but it needs both images at the same time - which the stock flow can't easily do, because by the time you've regenerated, the previous frame is gone. This node keeps it alive.

How it works

Nothing fancy, which is the point. The node keeps a tiny in-memory cache per node instance. When an image arrives, it returns that image as current and the previously cached one as previous, then stores the new image for next time. First run there's no previous image, so it returns the same image for both outputs. That's it - a screenshot-worthy ~30 lines of logic, no models, no VRAM, no state saved to disk.

Wiring it up

  • image - feed it the output of your VAE decode (or anything else you want to diff between runs).
  • current - this run's image.
  • previous - the last run's image.

The natural setup: wire VAE decode → this node's image, then current into Image Comparer input A and previous into input B. Queue once, compare both, tweak the prompt, queue again, slide the bar. You now have a proper before/after on your own iterations instead of squinting at two side-by-side windows.

Installing

Part of the TK3R Extensions pack:

  • ComfyUI Manager → search "TK3R Extensions" → Install, then restart.
  • Or cd ComfyUI/custom_nodes && git clone https://github.com/TK3R/ComfyUI_TK3R_Ext and restart.

Only dependency is rich. You'll also want the rgthree pack for the Image Comparer if you don't have it - that's the other half of this workflow.

The catches, such as they are

The cache is per node instance and lives only in memory. Restart ComfyUI (or delete and re-add the node) and the history resets - your first run after that will show the same image on both outputs. It also remembers one image per instance, not a whole history, so you only ever get the immediately previous generation. For longer sweeps you're better off saving frames to disk and using a batch compare. But for the "did that one word change help?" loop, this is the whole workflow in two wires.

CategoryTK3R/Utility

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (2)

NameTypeDescription
currentIMAGE
previousIMAGE