FSIM
The metric that scores what your eyes actually lock onto
- image_a
- image_b
- scales
- orientations
- min_length
- mult
- fsim
Here's the thing about SSIM and its cousins: they score everything, including the vast flat areas your brain skims right past. FSIM (Feature Similarity Index) inverts the priority. It's built on phase congruency - the "dimensionless" measure of how much local structure an image has - on the theory that what your visual system actually locks onto are the points where structure is strong: edges, corners, texture boundaries. Where FSIM's feature map is strong, the metric cares a lot; where it's flat, the metric barely looks. It consistently lands near the top of the classical IQA rankings, and it's one of the best pure-math metrics you can run on a comparison.
It's a node in comfyui-piq, Laurent Fainsin's wrapper around the piq library. Standard pack shape: image_a/image_b in, one FLOAT out, "piq" category. No model downloads.
How it works. Two components. Phase congruency, computed by a bank of log-Gabor filters at multiple scales and orientations (the scales and orientations inputs, 4 and 4 by default), is the primary similarity map - it's the "where's the structure" detector. Gradient magnitude is the secondary map, computed from the same filter responses. The two local maps get pooled into per-pixel similarity and weighted by how much feature strength is actually there, so empty regions don't dilute the score. The remaining knobs - min_length, mult, sigma_f, delta_theta, k - tune the log-Gabor filter bank itself. You will never touch these, and that's correct.
Inputs a beginner actually sets:
image_a/image_b- candidate vs. reference.data_range-1.0for ComfyUI's 0–1 floats.chromatic- defaults totrue, which upgrades FSIM to FSIMc by adding a color-similarity term on the chrominance channels. Leave it on; color information is free signal here.reduction-mean.
The fsim output is a FLOAT, roughly [0, 1], higher better.
Installing. ComfyUI Manager, search "comfyui-piq", Install. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Laurent2916/comfyui-piq.git
pip install -r custom_nodes/comfyui-piq/requirements.txt
piq>=0.8.0 is the whole dependency list; Python 3.12+; repo archived but stable.
Where it earns its keep. FSIM is a strong pick when you're ranking candidates by detail retention - upscaler shootouts, refiner A/B tests - because it rewards the parts of the image that actually read as "sharp" and "detailed" to a human. It's slower than SSIM/GMSD but still no neural network, so it's cheap enough to run per-batch. It's not learned and it still won't judge aesthetics; pair it with a learned metric when the decision matters and the two metrics disagree, trust the pattern, not the panic.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| image_a | IMAGE | Input image | |
| image_b | IMAGE | Reference image | |
| data_range | FLOAT | 1.00 | Maximum value range of images |
| reduction | COMBO | Reduction method | |
| chromatic | BOOLEAN | true | Whether to include color features |
| scales | INTEGER | 4 | Number of wavelet scales |
| orientations | INTEGER | 4 | Number of filter orientations |
| min_length | INTEGER | 6 | Minimum filter length |
| mult | INTEGER | 2 | Scale multiplication factor |
| sigma_f | FLOAT | 0.55 | Frequency spread |
| delta_theta | FLOAT | 1.20 | Angular interval between filter orientations |
| k | FLOAT | 2.00 | Scaling factor |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| fsim | FLOAT | Feature Similarity Index |