Image Compare (NH)
Put two images in one frame so you can actually see the difference
- image_a
- image_b
- image
"You changed the sampler, is it better?" is the eternal question, and the honest answer usually needs both images side by side. Image Compare (NH) is the node that forces the comparison: it takes two images and returns a single composited frame showing them together - side by side, stacked, split down the middle, or pixel-differenced. One output, wire it to a preview, and the difference is impossible to miss.
It plays the same role as the interactive comparer in rgthree's pack, with one practical difference: this is a data node. It outputs a real image, so the result can be saved to disk, fed into a grid, or included in a batch - not just eyeballed on the canvas.
How it works
Two image inputs (image_a, image_b) and a compare_mode dropdown with six personalities:
- side_by_side - A on the left, B on the right. The default, and the one you'll use 80% of the time.
- top_bottom - A above, B below. Good when the comparison is horizontal in nature.
- split_vertical - a vertical dividing line, left portion from A and right from B, with the boundary set by
split_position(0–1). This is the before/after slider effect baked into a static image. - split_horizontal - the same idea, but the line runs across the height: top from A, bottom from B.
- difference -
ImageChops.differenceoutput: pixels that match go black, changed pixels glow. The fastest way to see where two images differ rather than just that they differ. - overlay - A blended over B at
overlay_opacity(0.5 = half and half). Great for seeing alignment drift between frames or pass-throughs.
resize_method (lanczos, bicubic, bilinear, nearest) controls how B is scaled to match A's dimensions when they differ. B is always resized to A, so A is the reference - swap the inputs if you want the other one to own the canvas size.
Where it shines
- A/B testing samplers, seeds, or prompts: sample two ways, compare, keep the winner.
- Before/after documentation: original vs upscaled, source vs inpainted, draft vs refined.
- Quality control: difference mode catches a subtle seam or color shift that your eyes will happily skip in a side-by-side.
Wire it to a Save Image node and you get a comparison contact sheet in one step. Wire the outputs of two parallel branches in, and every run produces a side-by-side record of the two paths. That "every run documents itself" habit is worth developing.
Installing
Part of NH-Nodes, one-time setup:
cd ComfyUI/custom_nodes
git clone https://github.com/jetthuangai/NH-Nodes.git
cd NH-Nodes
pip install -r requirements.txt
Or search NH-Nodes in ComfyUI Manager and restart. No models, no downloads - it's PIL compositing with a resize guard.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image_a | IMAGE | — | |
| image_b | IMAGE | — | |
| compare_mode | COMBO | 6 options: side_by_side, top_bottom, split_vertical, split_horizontal, difference, overlay | |
| split_position | FLOAT | 0.500–1 | — |
| overlay_opacity | FLOAT | 0.500–1 | — |
| resize_method | COMBO | 4 options: lanczos, bicubic, bilinear, nearest |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |