LTXV Image Diff Metrics
Put a number on 'did this actually change anything'
- image_a
- image_b
- metrics
- image_a
- mse
- psnr
- l1
When you're tuning a conditioning strength or an AdaLN scale on something like this pack's LTXVEditAnythingLoopingSampler, eyeballing "does this look different" gets unreliable fast, especially across a batch of test renders. This node exists to replace that with numbers: feed it two images and it hands back mean squared error, PSNR, and L1 distance between them.
There's nothing fancy going on - no learned perceptual metric, no LPIPS-style network. All three numbers are classic, cheap pixel-space comparisons, which is exactly what you want for a debug node: fast, deterministic, easy to trust because there's no black box between your two images and the numbers you're reading.
Reading the three metrics
- MSE (mean squared error) - average squared pixel difference. Lower means more similar; it's the rawest of the three and the most sensitive to small, evenly-spread changes.
- PSNR (peak signal-to-noise ratio) - derived from MSE, but flipped so higher means more similar (it's a ratio, expressed on a log scale). This is the one most people recognize from video/image compression contexts.
- L1 - average absolute pixel difference. Less sensitive to occasional large outlier differences than MSE, so it's a useful second opinion when MSE spikes and you want to know if that's one bad region or a broad change.
None of these tell you where two images differ, only how much in aggregate - for that you'd want to look at the images directly, which is presumably why image_a is passed straight through as an output alongside the metrics, letting you wire it into a preview without a separate branch.
Inputs and outputs
Required: image_a, image_b. Optional: label (defaults to "A vs B", shows up wherever the comparison gets logged or displayed) and print_console (on by default, echoes the numbers to your ComfyUI console as the graph runs - handy when you're batch-testing several strength values and don't want to open a Show Text node for each one).
Outputs: metrics (a formatted string bundling all three numbers, likely what gets printed to console), image_a passed through unchanged, and the three raw floats mse, psnr, l1 for anything downstream that wants to compare numerically - a strength-sweep script, a threshold gate, whatever.
Installing it
Search "ComfyUI-BFSNodes" in ComfyUI Manager, or clone by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/alisson-anjos/ComfyUI-BFSNodes.git
cd ComfyUI-BFSNodes
pip install -r requirements.txt
Restart ComfyUI. Pure comparison utility - no model, no LoRA, works on any two same-sized images regardless of what generated them.
When to actually reach for it
This is a workflow-development tool, not something that belongs in a final production graph. The obvious use inside this pack: comparing a rendered frame against its guide/reference input while you're dialing in ref_strength, adaln_scale, or reference_guidance_scale on the identity and Edit Anything nodes elsewhere in this pack, so you have an objective number instead of relying on "that one looked more similar to me." If image_a and image_b are different resolutions, expect this to either error or silently produce meaningless numbers - there's nothing in the schema suggesting automatic resizing, so match your dimensions before wiring it in.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image_a | IMAGE | — | |
| image_b | IMAGE | — | |
| labelopt | STRING | A vs B | — |
| print_consoleopt | BOOLEAN | true | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| metrics | STRING | — |
| image_a | IMAGE | — |
| mse | FLOAT | — |
| psnr | FLOAT | — |
| l1 | FLOAT | — |