CLH 重复大模型文件检测
Find the checkpoints eating your disk twice
- duplicate_report
- log_output
If you've been running ComfyUI for a while, you have duplicate models. You know you do. The same 6GB checkpoint sitting in checkpoints/ and again in some workflow author's suggested folder, the same SDXL VAE copied three times, that Flux dev file you downloaded twice because you forgot the first one finished. Model files are enormous, and duplicates are pure wasted disk. This node hunts them down.
It's the odd one out in this pack - not an image node, not a text node, a straight-up disk-hygiene utility. You point it at a directory, it scans for duplicate large files, and it hands you back a report of what's doubled up so you can go delete the extras yourself. (It reports; it doesn't delete. Good - you want a human looking before anything gets removed.)
Why this is a real problem
This isn't a made-up use case. People genuinely fight model duplication - the community's usual workarounds are symlinks, extra_model_paths.yaml, or "Link Shell Extension" to avoid keeping the same checkpoint in two folders. When your model library is measured in hundreds of gigabytes, a handful of accidental duplicates is a checkpoint's worth of disk you're not getting back. A node that just tells you where they are is a genuinely useful thing to run once in a while.
How it works
It walks a directory, filters to files above a size threshold (so it ignores the thousands of tiny config and text files and only looks at the big stuff that matters), and finds the duplicates using multiple threads so a scan over a large model folder doesn't take all afternoon. Then it writes out two text reports.
The inputs and outputs that matter
directory_type- where to scan. It's a dropdown with three choices: the ComfyUI root, the model directory, or "other." Pick model directory for the common case.custom_directory(optional) - when you setdirectory_typeto "other," this is where you type the path to scan. Leave it blank otherwise.min_size_mb(default 100) - the size floor. Files smaller than this are ignored. The 100 MB default is sensible: it skips clutter and catches checkpoints, LoRAs, VAEs, and UNet files. Lower it if you're hunting duplicate LoRAs specifically.model_files_only(default on) - restrict the scan to actual model file types rather than any large file. Usually what you want.max_workers(default 4) - scan threads. Bump it up on a fast NVMe with lots of cores; leave it low on a spinning disk where more threads just means more seeking.
Two outputs, both STRING: duplicate_report (the list of what's duplicated) and log_output (the run log - what it scanned, how long it took). Wire either into a ShowText clh node to actually read it inside ComfyUI, or into a save-text node if you want it on disk.
Installing it
ComfyUI Manager: search Clh Tool for ComfyUI, install, restart. Or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/clhui/ComfyUi-clh-Tool
and restart. If it doesn't show up after a manual clone, check the startup console - Manager installs a pack's dependencies automatically but a bare clone leaves that to you.
Common issues
Two things to keep straight. First, it finds duplicates, it doesn't resolve them - the report is a to-do list, and the actual deleting is on you, which is the safe design. Don't expect a magic "clean up" button. Second, mind what "duplicate" means before you delete: a file that's genuinely referenced from two folders via a symlink or extra_model_paths.yaml may show up as two paths but is really one file on disk - removing "the duplicate" there breaks whichever workflow expects it. Read the report, confirm the two paths are actually two real copies, then clean up. Run it with a high min_size_mb first to catch the biggest wins, then lower the threshold if you want a deeper sweep.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| min_size_mb | INT | 1001–10000 | 最小文件大小阈值(MB) |
| model_files_only | BOOLEAN | true | 是否只扫描模型文件 |
| max_workers | INT | 41–32 | 最大并行线程数 |
| directory_type | COMBO | 模型目录 | 选择要扫描的目录类型 |
| custom_directoryopt | STRING | 当选择'其他'时,输入自定义目录路径(支持多个目录,每行一个) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| duplicate_report | STRING | — |
| log_output | STRING | — |