Nodes/Lyonir Studio/๐Ÿบ Lyonir Image Compare
ComfyUI Node

๐Ÿบ Lyonir Image Compare

Comparing Two Images Without Filling Up Your Output Folder

By LyonirยทCreated 24 days agoยทUpdated 8 days agoยท 3
๐Ÿบ Lyonir Image Compare
  • image_a
  • image_b
  • image_a

You just ran the same prompt through two upscalers, or two seeds, or with the ControlNet branch muted and enabled. Now you have six PNGs in output/ with names like ComfyUI_00417_.png and no idea which is which. ๐Ÿบ Lyonir Image Compare exists so that comparison happens on the canvas instead of in your file manager.

What it's for

This is an A/B viewer. You feed it two images, it draws them stacked with a draggable divider and an A label on the left, B on the right, so you can wipe between them at the exact same spot. The node description sums it up: "Preview the images without saving them to the ComfyUI output directory."

The obvious question is why you wouldn't just use the two Preview nodes you already have, and the honest answer is that a slider beats eyeballing two thumbnails on different sides of the screen. If you already run rgthree, you have an Image Comparer that does something similar - the difference here is the specific pairing of two explicit IMAGE inputs plus a live passthrough of the A side, which means the node can sit inside a chain rather than at the end of one. You can compare, then keep going.

How it actually works

The backend class subclasses ComfyUI's own PreviewImage and sends both inputs down the exact same path core previews use - which writes into ComfyUI's temp directory, not output/. Nothing touches your output folder, which is the whole point.

The interesting part is what the backend doesn't do: it does no comparison math at all. It stages two sets of preview files under the UI keys lyonir_compare_a and lyonir_compare_b, and the frontend does the rest. This pack ships its own web/image_compare.js, which builds a DOM widget layered over the node with the divider, the drag handle, and the copy-image action. That architecture is deliberate - a canvas-based widget would have been easier when this was written, but the DOM approach is what still renders on the modern Nodes 2.0 frontend, which is exactly where a lot of older utility packs broke.

Inputs and outputs

Only two inputs, both required, both IMAGE: image_a and image_b. There are no widgets, no sliders to configure in the node itself, nothing to set.

The single output is also called image_a, typed IMAGE. It's a passthrough of the A input - pick your winner by rewiring the graph or by simply saving whichever side you liked. Since the node is an output node, it executes even when nothing downstream is connected to it, so you can leave it dangling as a pure viewer. Wire the passthrough into a Save Image or Save Video node when you want to actually keep the result.

Install

The whole pack, via ComfyUI Manager - search the pack title ComfyUI-Lyonir-Studio - or from a terminal:

cd ComfyUI/custom_nodes
git clone https://github.com/Lyonir/ComfyUI-Lyonir-Studio.git
python -m pip install -r ComfyUI-Lyonir-Studio/requirements.txt

On the Windows portable build, use the embedded Python so you install into the environment ComfyUI actually runs:

.\python_embeded\python.exe -m pip install -r .\ComfyUI\custom_nodes\ComfyUI-Lyonir-Studio\requirements.txt

The requirements are light - opencv-python, numpy, Pillow, and imageio-ffmpeg on Linux/macOS only. The file's own header comment says not to pin or replace Torch, Torchvision or Transformers, which is the right instinct: this pack is not here to fight with your model stack. Restart ComfyUI, and hard-refresh the browser, because the comparison widget is frontend JavaScript.

Where people trip

Nothing gets saved. That is the feature, not a bug - but it means there's no PNG to drag back in and recover your workflow from, and no metadata chunk. Save with a real Save node if the image matters.

Previews live in temp. ComfyUI's temp directory gets purged on restart and by the Clear button in the queue panel. If the comparison panel goes grey after a while, that's why. Re-run the graph.

Two batches, not two images. The frontend reads the first image from each side's payload. Feed it a 121-frame video batch and you're looking at frame 1 versus frame 1. Add an ImageFromBatch (or any frame-picking node) if you want to compare a specific frame.

Blank widget after a pack update. Updating adds or changes files under web/. Restart ComfyUI and refresh the browser tab; a cached old frontend against new backend files is the usual cause.

Unconverted widget inputs go quiet. If you converted a widget to an input and left it unconnected, the node still runs. Double-check both IMAGE sockets are actually wired before you conclude the node is broken.

CategoryLyonir Studio/Image

Inputs (2)

NameTypeDefaultDescription
image_aIMAGEโ€”
image_bIMAGEโ€”

Outputs (1)

NameTypeDescription
image_aIMAGEโ€”