Skip to content

核心功能点 多哈希比对:同时计算 aHash、pHash、dHash,提升图片相似判断准确度。 自动跳过重复图片:检测到重复内容后自动终止节点执行,节省显存与时间。 缓存机制:自动将新图片及其哈希保存至 /cache/images 文件夹。 详细日志输出:输出每次对比的哈希差异和判断结果,便于调试。 自适应阈值补偿:根据历史缓存图片自动微调阈值,兼顾相似图片的识别率。 节点参数注释:在 ComfyUI 工作流界面内显示参数说明,便于理解。 跳过逻辑控制:可选开启“Skip Node”功能,直接跳过重复图片节点。

Notifications You must be signed in to change notification settings

ziwaixian/ComfyUI-CheckImageCacheRobust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CheckImageCacheRobust Preview

image

ComfyUI-CheckImageCacheRobust

核心功能点 多哈希比对:同时计算 aHash、pHash、dHash,提升图片相似判断准确度。 自动跳过重复图片:检测到重复内容后自动终止节点执行,节省显存与时间。 缓存机制:自动将新图片及其哈希保存至 /cache/images 文件夹。 详细日志输出:输出每次对比的哈希差异和判断结果,便于调试。 自适应阈值补偿:根据历史缓存图片自动微调阈值,兼顾相似图片的识别率。 节点参数注释:在 ComfyUI 工作流界面内显示参数说明,便于理解。 跳过逻辑控制:可选开启“Skip Node”功能,直接跳过重复图片节点。

🧠 CheckImageCacheRobust for ComfyUI

A smart image cache checker node for ComfyUI, which automatically detects and skips duplicate images by computing perceptual hashes (aHash, pHash, dHash).
This helps to avoid redundant processing and speed up batch workflows.


✨ Features

  • ✅ Compute and compare image similarity using aHash, pHash, and dHash.
  • 🚀 Automatically skip nodes if the image already exists in cache.
  • 💾 Saves generated images into /root/ComfyUI/cache/images/.
  • 🧠 Provides detailed log output for debugging.

🛠️ Installation

cd ComfyUI/custom_nodes
git clone https://github.com/yourname/ComfyUI-CheckImageCacheRobust.git
pip install -r requirements.txt

## 🔍 功能亮点说明

| 功能点 | 描述 | 技术细节 |
|:--------|:------|:-----------|
| 🧩 多重感知哈希 | 使用 `imagehash` 库生成 `aHash``pHash``dHash` | 同时分析亮度均值、离散余弦特征、差异梯度 |
| ⚖️ 哈希相似度判断 | 自动计算汉明距离总差值 | 提供自适应阈值,自动容忍轻微亮度或尺寸变化 |
| 💾 缓存管理 | 每张图片缓存 `.png` 与对应 `.json` 哈希文件 | 避免重复生成,支持快速命中 |
| ⏭️ 节点跳过机制 | 检测到重复图片后返回 Skip 信号 | 保持 ComfyUI 流程稳定 |
| 🧠 日志系统 | 打印详细的对比过程 | 包含差异详情与重复检测结果 |
| 🎨 可视化提示 | 工作流节点带 emoji 名称与参数提示 | 方便快速识别与调试 |
| 🩹 自动修复浮点范围 | 修正浮点类型图片 `data_range` 报错 | 自动规范化像素范围至 `[0,255]` |

About

核心功能点 多哈希比对:同时计算 aHash、pHash、dHash,提升图片相似判断准确度。 自动跳过重复图片:检测到重复内容后自动终止节点执行,节省显存与时间。 缓存机制:自动将新图片及其哈希保存至 /cache/images 文件夹。 详细日志输出:输出每次对比的哈希差异和判断结果,便于调试。 自适应阈值补偿:根据历史缓存图片自动微调阈值,兼顾相似图片的识别率。 节点参数注释:在 ComfyUI 工作流界面内显示参数说明,便于理解。 跳过逻辑控制:可选开启“Skip Node”功能,直接跳过重复图片节点。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages