SRSIM
The cheap metric that knows where your eyes go
- image_a
- image_b
- kernel_size
- gaussian_size
- srsim
SRSIM (Spectral Residual based Similarity) has the same instinct as FSIM - weight the score by where your eyes actually go - but gets there with a much cheaper trick. Instead of a bank of log-Gabor filters, it computes a saliency map from the spectral residual: take the image's log spectrum, subtract the averaged/smoothed spectrum, and what's left over is roughly "what's surprising about this image." That residual becomes the saliency weight for a local SSIM-style comparison. It's a smart, fast hack, and it performs remarkably well for its cost.
It's one of the seventeen nodes in comfyui-piq, Laurent Fainsin's wrapper around the piq library. Same pattern as every node here: image_a and image_b in, one FLOAT out, "piq" category, no model downloads.
How it works. The spectral residual saliency map is computed once per image (piq uses a log-Gabor filter to smooth the spectrum, which is why you see scale, sigma, kernel_size, and gaussian_size in the inputs - they tune that smoothing). Then the local similarity map - luminance, contrast, structure, same bones as SSIM - is weighted by the saliency, so surprising, detail-rich regions count more than uniform ones. chromatic (default false) upgrades it to SRSIMc, adding a chrominance comparison. Higher is better, 1.0 identical.
Inputs a beginner actually sets:
image_a/image_b- candidate vs. reference;image_bis ground truth.data_range-1.0for ComfyUI's 0–1 floats.chromatic- flip totrueif your images are color and you want the chroma term; cheap to test both ways.scale,kernel_size,sigma,gaussian_size- paper defaults, leave them.
The srsim output is a FLOAT in roughly [0, 1].
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
That's the whole install: piq>=0.8.0, Python 3.12+. The repo is archived, the math isn't going anywhere.
The honest take. SRSIM is a sleeper pick. It's faster than FSIM, has the same "pay attention to the interesting parts" philosophy, and holds up in benchmark rankings better than its obscurity suggests. For iterating on upscale/refine candidates where you want a saliency-aware number without paying FSIM's cost, it's genuinely nice. It's still a traditional metric, so it won't judge whether an image looks good - only how faithfully it matches a reference where it matters. That's a job, and it does it well.
Inputs (9)
| 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 | false | Whether to include color features |
| scale | FLOAT | 0.25 | Scale parameter |
| kernel_size | INTEGER | 3 | Size of the kernel |
| sigma | FLOAT | 3.80 | Standard deviation for Gaussian kernel |
| gaussian_size | INTEGER | 10 | Size of the Gaussian kernel |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| srsim | FLOAT | Spectral Residual based Similarity |