Image Pair Compare
A/B your renders side by side with tabs, like rgthree's comparer
- images_a
- images_b
- images
Tuning a workflow means staring at two sets of renders and asking "is the new one actually better?" That's a miserable experience if your previews are scattered across separate Save nodes. XJImagePairCompare is a comparison display node that takes two image batches - call them A and B - and shows them as paired, tabbed, side-by-side comparisons in the UI, so you can flip between pairs 1, 2, 3… and judge them together.
The author was explicit about the inspiration: it's a take on rgthree's Image Comparer, the gold standard for this in the ecosystem. rgthree's version has a slide-to-compare slider that's genuinely great; this one leans more on numeric tabs plus slide and click modes. It's from the same small personal pack (ComfyUI-XJNodes), so don't expect rgthree's polish or community support - but for a quick A/B it gets the job done.
How it works
Under the hood it subclasses ComfyUI's own PreviewImage, so it's fundamentally an output/preview node: it renders both batches into the frontend and hands the pairs to a custom JS widget that shows them together. The actual logic is mostly bookkeeping. It validates that images_a and images_b have the same number of images - the one rule you must respect - and raises a clear error if you feed it 4 images against 6. Then each batch is sent to the preview with a xj.compare. filename prefix, and the UI builds the tabbed pair view with image sizes displayed under each frame.
The important mental model: this is a viewing node. It doesn't modify anything, doesn't merge, doesn't blend. If you want to keep a result, save it elsewhere; the pair view is there to help you decide.
The inputs and outputs
images_a(IMAGE, optional) - the "before" batch.images_b(IMAGE, optional) - the "after" batch.- Output:
images(IMAGE), though as an output node its real deliverable is the UI comparison view.
To use it, wire the same number of frames from two pipeline branches. A classic setup: run the same prompt with two different samplers or CFG values, batch each into a FromBatchSize or VAE Decode output, and feed both into this node. When a pair looks off, right-click out of it and inspect the inputs upstream.
Installing it
It ships with ComfyUI-XJNodes:
cd ComfyUI/custom_nodes
git clone https://github.com/alexjx/ComfyUI-XJNodes
then restart ComfyUI (or install via ComfyUI Manager by searching ComfyUI-XJNodes). No models, no extra dependencies - it leans on the preview machinery ComfyUI already has.
Common issues
The mismatch error is the main one: A/B batches must have equal frame counts, or the node refuses with Image count mismatch. If you're comparing a batch of 4 against a batch of 5, either pad the shorter one or slice the longer. Beyond that, remember this is a preview tool, not an archive - save what you're comparing before you change anything upstream, or your "after" vanishes when you re-run. And temper expectations for a personal-pack comparer: it's handy, but rgthree's remains the one with the community track record.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images_aopt | IMAGE | — | |
| images_bopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |