A comprehensive Image Quality Assessment (IQA) custom node collection for ComfyUI. This pack leverages PyIQA for deep learning-based metrics, OpenCV for classical computer vision metrics, and advanced Analysis Tools for detailed image inspection.
-
PyIQA Deep Image Analysis:
- Access to a vast zoo of state-of-the-art IQA models (HyperIQA, MUSIQ, NIMA, LPIPS, FID, SSIM, etc.).
- Smart Caching: Models are cached in memory to avoid reloading.
- Batch Support: Processes batches with configurable aggregation.
- Automatic Device Detection: Runs on CUDA if available.
-
OpenCV & Analysis Tools:
- Classical Metrics: Blur, Brightness, Contrast, Colorfulness, Noise.
- Advanced Analysis: Color Harmony, Color Temperature, Defocus (FFT), Clipping, Entropy.
- Visualizations: Histograms, Heatmaps, Color Wheels, Edge Maps.
-
Logic & Visualization:
- Filtering & Ranking: Filter or sort images based on quality scores.
- Ensemble: Combine multiple scores.
- Frontend Integration: Real-time score display on nodes.
-
Clone this repository into your
ComfyUI/custom_nodesfolder:cd ComfyUI/custom_nodes git clone https://github.com/yourusername/ComfyUI-IQA-Node.git -
Install dependencies:
pip install -r requirements.txt
Note: This version uses a vendored version of
pyiqato prevent dependency conflicts (like downgradingtransformersornumpy). All originalpyiqametrics are available except forqalign, which is disabled due to its strict requirement for an older version oftransformers.
- IQA: PyIQA No-Reference: Evaluate aesthetics/quality (HyperIQA, MUSIQ, NIMA, etc.).
- IQA: PyIQA Full-Reference: Compare against reference (LPIPS, SSIM, PSNR, FID, etc.).
- IQA: Blur Estimation: Global blur detection (Laplacian/Tenengrad).
- IQA: Brightness & Contrast: Basic statistics.
- IQA: Colorfulness: Vividness metric.
- IQA: Noise Estimation: Wavelet-based noise estimation (MAD).
- IQA: Edge Density: Edge complexity.
- IQA: Saturation: Average/Max saturation.
- Analysis: Blur Detection: Block-based blur analysis with heatmaps.
- Analysis: Color Harmony: Identifies color schemes (Complementary, Triadic) and displays color wheel.
- Analysis: Color Cast: Detects and visualizes unwanted color tints.
- Analysis: Color Temperature: Estimates Kelvin temperature and labels (Warm/Cool).
- Analysis: Clipping: Visualizes clipped highlights/shadows or saturation.
- Analysis: Defocus: FFT-based frequency analysis to detect defocus.
- Analysis: Edge Density: Detailed edge density analysis with maps.
- Analysis: Entropy: Measures information content/entropy (bits).
- Analysis: Noise Estimation: Variance-based noise mapping.
- Analysis: RGB Histogram: Renders RGB histograms for the batch.
- Analysis: Sharpness/Focus: Hybrid scoring (Laplacian + Tenengrad).
- IQA: Threshold Filter: Route images based on score.
- IQA: Batch Ranker: Sort images by score.
- IQA: Ensemble Scorer: Weighted average of scores.
- IQA: Score Normalizer: Scale/Invert scores.
- IQA: Heatmap Visualizer: Apply colormaps to raw value maps.
- Use Analysis: Defocus or IQA: Blur Estimation to filter bad generations.
- Use Analysis: Color Harmony to verify prompt adherence (e.g., "teal and orange").
- Use IQA: Batch Ranker to pick the best image from a large batch.
- IQA-PyTorch for DL metrics.
- ComfyUI.
- ThatGlennD/ComfyUI-Image-Analysis-Tools for analysis logic.