Reference Image Comparer
Swipe your new output against a fixed reference, without leaving the graph
- image
You're tuning a prompt, a sampler config, or a whole model swap, and you need to know whether the new output is actually better than the one you already liked. The reference image comparer exists so you don't play that game by opening a folder of PNGs in your image viewer and tabbing between them. You pin one baseline image on the left side of a node, wire your current result in, and hover to swipe a split line across - left half shows the reference, right half shows whatever just came out of the sampler.
It's a single output node (category image) that does nothing to your pixels. Think of it as a specialized preview: it subclasses ComfyUI's own PreviewImage, so it sits at the end of a graph, shows a comparison, and saves both images like any preview node would. The swipe UI is a deliberate clone of the Image Comparer in rgthree-comfy, the quality-of-life pack that's part of everyone's standard install - but with one twist that makes it genuinely useful for A/B testing: rgthree's version compares two outputs you feed in, while this one always keeps the left side locked to your reference and shows the newest result on the right. That's the "is this a regression or an improvement" workflow, and it's a good fit for it.
How it works
The mechanism is simple enough that you could trust it blind, but it's worth knowing the two ways the reference gets in. There are really only two inputs you'll set:
- reference_image - a dropdown of every image already in ComfyUI's
inputfolder, with an upload button if your reference lives elsewhere. The picker only lists image files (png, jpg, jpeg, webp, gif, bmp), which saves you the classic "why is my workflow file in here" moment. - reference_image_path - an absolute path to a reference file anywhere on disk. The tooltip says it plainly: when non-empty, it overrides the picker. Handy when the baseline lives outside
inputand you don't want to copy it.
Then you wire your generated image into the image input and run. The node saves both sides, and the frontend draws a swipe slider: drag it, or just hover and move your mouse over the preview - no click needed. Each side gets a little label ("reference" top-left, "result" top-right) so you never forget which is which mid-tune.
Two behaviors make it nicer than a static side-by-side. First, the reference preview updates as soon as you pick a different file, no run required - the left side reflects your picker instantly. Second, the node hashes the reference file's path and modification time, so if the baseline changes on disk, the node re-runs itself and your comparison stays honest without you remembering to re-queue.
Installing it
No models to download, no Python dependencies - pyproject.toml declares an empty dependency list, which after your third pack that drags in half of PyTorch-land is a relief. Via ComfyUI Manager, search "Reference Image Comparer" and hit install. Or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/r0zaic/comfyui-reference-image-comparer
Then restart ComfyUI (or hit refresh in Manager). The node shows up under the image category.
Where people get burned
The one real trap is the path override: reference_image_path must be an absolute path to a file that exists. If you feed it a relative path or a typo, the node raises a clear error ("Reference image not found: ...") rather than silently falling back - which is the right behavior, but it means the override is all-or-nothing. The picker, meanwhile, is built when the node loads, so a brand-new file you drop into input after ComfyUI is already running may not appear in the dropdown until you refresh or restart. There's no batch mode either: one reference, one result, per node - if you're diffing a whole run against a baseline, you're wiring up several of these. Small pack, one job, does it well.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| reference_image | COMBO | 1 options: example.png | |
| imageopt | IMAGE | — | |
| reference_image_pathopt | STRING | Optional absolute path to the reference image. Overrides the picker above. |
Outputs (0)
No outputs