π BV Image Difference Heatmap
See exactly where two images differ β and by how much
- image1
- image2
- heatmap
- overlay_image1
- overlay_image2
- difference_strength
- mse_value
"How much did that actually change?" is a question you ask constantly once you start iterating on generations, and eyeballing two images side by side is a terrible way to answer it. BV Image Difference Heatmap gives you the honest version: it compares two images pixel by pixel and paints the differences as a heatmap, plus hands you a couple of hard numbers so you can stop squinting.
The realistic use cases: before/after an upscale or img2img pass, checking how much a low-denoise refiner actually moved, or comparing two generations against a reference. It's the kind of node that's not going to make your images better by itself - it makes your judgments better, which eventually does.
The inputs
- image1 / image2 (both required) - the pair to compare. Feed them same-size images; a 512Γ512 against a 2048Γ2048 comparison is meaningless even if it doesn't error.
- overlay_strength (default 0.5, range 0β5) - how strongly the heatmap blends over the originals in the overlay outputs. Crank it toward 5 if the difference is subtle and you want it loud.
- colormap - the palette, straight from matplotlib's set:
jet,viridis,plasma,inferno,magma,cividis,turbo,hot,cool, plus the reversed variants of most of them (jet_r,viridis_r, ...). For "where is the difference,"jetorturboare the classic choices;hotreads nicely for magnitude.
The outputs
- heatmap (IMAGE) - the raw difference map in your chosen colormap.
- overlay_image1 / overlay_image2 (IMAGE) - the heatmap blended over each original at
overlay_strength. These are what you'll actually want to look at. - difference_strength (FLOAT) - a scalar summarizing how much the images differ overall. Feed it into a conditional node to gate the rest of the workflow on "did this change enough?"
- mse_value (INT) - the mean squared error, rounded to an integer. The boring-but-useful number for logging or comparing runs.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/BlackVortexAI/ComfyUI-BVortexNodes.git
or ComfyUI Manager β "BV Nodes", then restart. The colormaps come from matplotlib, which ComfyUI usually has on hand - if the node throws an import error, pip install matplotlib fixes it.
Where people get confused
The mse_value output being an INT rather than a float is a minor quirk - don't expect fractional precision from it. And remember the overlay outputs are where the visual answer lives; the raw heatmap alone is harder to read because the dark pixels of the original aren't there as a reference frame. Same-size images in, comprehensible answer out - that's the whole contract.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image1 | IMAGE | β | |
| image2 | IMAGE | β | |
| overlay_strength | FLOAT | 0.500β5 | β |
| colormap | COMBO | 18 options: jet, viridis, plasma, inferno, magma, cividis, +12 |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| heatmap | IMAGE | β |
| overlay_image1 | IMAGE | β |
| overlay_image2 | IMAGE | β |
| difference_strength | FLOAT | β |
| mse_value | INT | β |