ComfyUI Node

Simple Compare

Flip between two images without saving forty PNGs

By dimdieo·Created 11 days ago·Updated 11 days ago· 0
Simple Compare
  • image_a
  • image_b
  • image

You ran the same seed through two checkpoints, or upscaled one branch and not the other, and now you want to look at both. The stock ComfyUI answer is two Preview Image nodes side by side, which works right up until you're zoomed in on the pixels and panning back and forth like you're watching a tennis rally.

Simple Compare is the single-node version of that. Two IMAGE inputs, one preview, click the preview to flip between A and B. That's the whole feature list, and that's the point.

What it actually is under the hood

The class subclasses ComfyUI's own PreviewImage, which tells you two useful things at once.

First, it writes to ComfyUI/temp/, not ComfyUI/output/. Same deal as the core Preview Image node: scratch PNGs in a temp directory instead of hundreds of finals filling output/. The node description says exactly this, and it's honest. It's also the standard Preview Image trade-off - if it looked good and you closed the tab, it's gone, so swap in a real save before the run you care about.

Second, the frontend swaps the stock preview for a custom canvas widget with a DOM image layer over it. The click-to-toggle is that widget's pointerup. Dragging the preview into another node works because the visible image is a real <img> element sitting over the canvas, so the browser hands its URL to the target node. Right-clicks and wheel events get forwarded back to the canvas, so you keep the node's context menu and canvas zoom while your cursor is over the image.

Inputs and the one output

Both inputs are optional IMAGE: image_a and image_b. Those are the only two, and there's nothing to configure. Connect one or both, run, click.

The output is a single IMAGE named image, and here's the part worth reading twice: the output is image_a whenever image_a is connected, otherwise image_b. The toggle is cosmetic. Flipping to B on screen does not change what travels down the wire - wire the output onward and you get A, always. People who expect the click to pick a branch get confused a week later.

Two smaller behaviours, both from the source rather than the README:

  • If you feed it a batch, both inputs produce multiple temp files and the widget cycles through all of them - A1, A2, B1, B2 - on repeated clicks. Handy for contact-sheeting, tedious when you wanted two.
  • The node is an output node and its IS_CHANGED returns NaN, the classic always-dirty idiom. It re-runs every queue, which is what you want for a preview, but it does mean two temp files on every single run.

Installing it

There's not much to install: a couple of small Python files, one JS file, no requirements.txt, no pip step, no models, no dependency on any other node pack. That's the actual argument for it - compare nodes have a habit of dragging in an entire utility pack.

ComfyUI Manager: search Simple Compare and restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/dimdieo/ComfyUI-Simple-Compare.git simple-compare

Restart ComfyUI, then search "Simple Compare" on the canvas. That's it - if it doesn't appear, you cloned into the wrong directory or you didn't actually restart.

Where people get burned

The preview is blank and clicking does nothing. Both inputs being optional means the node happily runs with nothing connected - no error, no image, no clue. Connect one first, then diagnose.

It worked, then a ComfyUI update ate it. When compare nodes died for people in early 2026, the fix was a nightly build or a different node entirely - the cause was frontend churn. Click-to-flip previews are custom canvas widgets, which is about the most fragile thing you can put in a ComfyUI node. First move after an update: hard-refresh (Ctrl/Cmd+Shift+R) so the browser picks up the new web/simple_compare.js instead of the cached one. Second: check whether you're on the newer frontend and switch back to the legacy canvas.

The click registers but doesn't switch. There's a debug switch in the JavaScript. Open the browser console, run this, then reload the page:

localStorage.setItem("simpleCompareDebug", "1")

You'll get console lines for pointer down, up, drag and toggle, which tells you if the widget sees your clicks at all. Clear it with localStorage.removeItem("simpleCompareDebug") afterwards. A click that drags slightly won't toggle - the widget distinguishes a press from a drag on purpose, so dragging the image out doesn't flip it.

You wanted a slider. This isn't one. It's flip, not wipe - no divider, no difference mode. For a wipe, that's rgthree's Image Comparer - excellent when it works, but it's a whole utility pack and it was one of the things that broke under the Nodes 2.0 rewrite. Simple Compare is what you reach for when you want two pictures and a click.

Categoryimage

Inputs (2)

NameTypeDefaultDescription
image_aoptIMAGE—
image_boptIMAGE—

Outputs (1)

NameTypeDescription
imageIMAGE—