Nodes/ComfyUI_JosiaNodes/Josia图像对比
ComfyUI Node

Josia图像对比

A/B your generations side-by-side, the way you actually want to

By Josia-doit·Created 6 months ago·Updated a day ago· 16
Josia图像对比
  • 图像A
  • 图像B
  • 拼接图像

JosiaImageComparer (Josia图像对比) is the "did the LoRA actually help?" node. You've got two images - before and after, A and B, seed 42 vs seed 43 - and you need to compare them at real resolution without tiling your screen with preview windows. This node wires both images in, lets you flip between them, and, bonus, spits out a properly-stitched combined image you can save.

The two interaction modes

  • Slide mode: drag your mouse across the image and a vertical divider follows it - image A on the left of the line, image B on the right. The classic before/after slider.
  • Click mode: hold the mouse button to show image B, release to show A. Best for quick flick-compare: press, release, press, release, and the difference practically announces itself.

Both modes work on a single enlarged preview, so you can pull the node big and actually inspect the hair strands instead of squinting at two thumbnails. The preview inherits the behavior of ComfyUI's built-in PreviewImage, including auto-saving previews.

The output that makes it more than a viewer

The single output, 拼接图像 (stitched image), is a real IMAGE tensor, not just a preview: it concatenates image A and image B side-by-side along the width. Two details in the source keep that from being a crash:

  • If the heights don't match, B gets resized to A's height with lanczos interpolation before joining - no misalignment, no black bands from a mismatch.
  • Channel counts are reconciled: a 4-channel RGBA image from one branch and a 3-channel RGB from another (which newer ComfyUI LoadImage nodes default to) get aligned by padding the missing alpha, which is exactly the bug that silently breaks naive concatenation.

Wire that stitched output into a Save Image node and you've got a permanent A/B contact sheet - genuinely useful when you're iterating on prompts and want the pairs on disk. Feed only one image and it passes through untouched; feed neither and it outputs empty.

Install

This is part of ComfyUI_JosiaNodes, zero extra Python dependencies:

cd ComfyUI/custom_nodes
git clone https://github.com/Josia-doit/ComfyUI_JosiaNodes

or install via ComfyUI Manager (search ComfyUI_JosiaNodes) and restart. It appears under the Josia category, labeled 图像对比.

Notes and gotchas

The compare interaction is frontend JavaScript (web/js/image_comparer.js) - keep the web/js folder intact or the sliding/clicking dies while the output still works, which is the confusing failure mode. Labels are Chinese: 图像A and 图像B for the two optional inputs. And a fair warning on expectations: the stitched output is a side-by-side join, not a blend or a diff. If you want a pixel-difference heatmap or a flicker-compare animation, this isn't the node - but for "is the right side better than the left," it's exactly right.

Category⚡️JosiaNodes

Inputs (2)

NameTypeDefaultDescription
图像AoptIMAGE
图像BoptIMAGE

Outputs (1)

NameTypeDescription
拼接图像IMAGE