π FRED Image Quality Inspector (piq)
BRISQUE, blur, SNR, compression
- image
- mask
- BRISQUE
- BLUR
- SNR
- COMPRESSION_RATIO
- help
"Is this output actually better, or am I just fooling myself?" FRED_ImageQualityInspector gives you numbers to argue with. It computes four quality metrics on an image - perceptual quality, sharpness, noise, and compression damage - with no reference image needed, and it can restrict the sharpness/noise math to a mask region so you're scoring the part you care about.
The four metrics
- BRISQUE - a no-reference perceptual quality score from the
piq(PyTorch Image Quality) library. Lower raw BRISQUE is better; scores in the 20β40 range are typical for clean generated images, and it climbs fast as artifacts creep in. This is the metric people actually cite when comparing upscalers. - BLUR - variance of the Laplacian. Higher = sharper. It's the classic cheap sharpness heuristic; it can't tell "soft focus" from "smooth skin texture," but it's a reliable relative measure when comparing two versions of the same image.
- SNR - signal-to-noise ratio in dB. Higher = cleaner. Useful for spotting banding/noise, and it's unrestricted by default along with blur.
- COMPRESSION_RATIO - a proxy: it re-encodes the image as JPEG@95 and compares sizes to estimate how much redundancy/compression damage is present. Not a true measurement, but a decent tripwire for heavily re-compressed sources.
Scaled or raw
scale_output_0_100 (default on) rescales everything to a 0β100 score where 100 = best. That's the friendly mode: BRISQUE inverted and clamped, blur mapped through a saturating curve, SNR mapped with 0dBβ0 and 40dB+β100. It makes comparisons legible ("63 vs 71, the second one is cleaner") without having to remember what a "good" BRISQUE is.
Flip it off and you get the raw values: real BRISQUE, real Laplacian variance (unbounded), real SNR in dB. If you're building an automated filter or want to log canonical units, raw is the honest choice.
The mask option
Feed an optional mask and blur/SNR are computed only inside the masked region. That's the feature that makes this node actually useful for face work: score the sharpness of the face region specifically instead of letting a busy background drag the number around. (BRISQUE always runs on the full image - it needs global context.)
What it's for
- A/B upscaler comparisons without eyeballing. Upscale with two methods, run both through this, take the better score.
- Batch filtering - the normalized outputs are plain FLOATs, so you can wire them into logic ("if BRISQUE < 40, keep") or log them next to filenames via FRED_Save_Text_File.
- Grounding a suspicion. That "something looks off" feeling is usually blur or noise; the metric tells you which.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Poukpalaova/ComfyUI-FRED-Nodes_v2.git
Restart, or "ComfyUI FRED Nodes v2" in Manager. This node is one of the reasons the pack's install is heavy: it pulls piq and opencv-python (plus the pack's git dependency on ocampor/image-quality). First run on a fresh environment will take a while.
Gotchas
Don't over-read single metrics. A sharp image that looks like crunchy noise will score great on blur and terribly on BRISQUE - the combination is the signal. And the normalized scores saturate; once BRISQUE-ish quality gets very good, two great images may both read ~95 and stop being distinguishable. For fine comparisons, switch to raw mode.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| scale_output_0_100 | BOOLEAN | true | β |
| maskopt | MASK | β |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| BRISQUE | FLOAT | β |
| BLUR | FLOAT | β |
| SNR | FLOAT | β |
| COMPRESSION_RATIO | FLOAT | β |
| help | STRING | β |