Analyze Checkpoint Similarity (2 Models)
Compare two checkpoints before you merge them — and find out if merging is even worth it
- comparison_report
- cwb_report
- documentation
Before you merge two checkpoints, you'd love to know how much they actually overlap - which layers agree, which differ wildly, and whether one is a derivative of the other. That's exactly what this node does, and it does it without writing a single file. It reads two checkpoint safetensors from your models/checkpoints folder, streams them through side by side, and hands you two text reports: a standard metrics comparison and a separate CWB diagnostics report.
How it works
Both files are loaded in low-memory mode via the Unified Efficient Loader (UEL), so a couple of multi-gigabyte checkpoints don't have to sit in RAM at once. Tensors are compared per layer in fp32, which is what you want for a fair comparison. The standard report gives you the usual suspects - MAE, MSE, RMSE, maximum absolute difference, relative L2, cosine similarity, Pearson correlation - plus the things averages hide: exact equality, sign agreement, and norm ratio. Every comparable tensor gets its own entry, so you can see where the two models diverge, not just that they do.
Two honest design choices are worth knowing about. Missing keys and shape mismatches are listed separately and never padded, cropped, or zero-filled - the node won't pretend two different models are the same shape. And checkpoints carrying ComfyUI quantization metadata are rejected outright, because quantized storage values don't represent directly comparable weights. If you try to compare a Q8 against an fp16 and get an error, that's why.
The CWB report is the more interesting half. It computes row-wise cosine statistics between the two models and each one's affinity to a mean and median consensus - the same machinery the pack's CWB merger nodes use for actual blending. So you can look at the report and predict how a CWB merge of these two would behave before you commit disk space to it.
The inputs that matter
- execution_mode -
ANALYZEstreams both files and produces the reports.DOCUMENTATION ONLYloads nothing and just returns the node's reference doc. Handy for a first poke at the node. - model_a / model_b - the two files. A is the "anchor" in the reports; keys unique to each are reported separately.
- top_weight_differences (default 20) - how many of the largest individual weight differences make it into the detailed list. Zero kills the list; crank it up to 1000 if you want the full bottom of the barrel.
- exclude_patterns / glob_patterns - one pattern per line to leave tensors out of the metrics. Regex by default; flip the toggle for shell-style globs. Useful when you know some layer (say, the VAE or a frozen branch) is identical and you don't want it dominating the numbers.
- process_device and force_clear_cache - device for the per-layer math (CUDA OOM retries that layer on CPU), and whether to flush Python/GPU caches after every work unit. Cache clearing is on by default; it saves memory and slows things down, which is the right tradeoff for most people.
Wiring the outputs
The node returns comparison_report, cwb_report, and documentation - all plain text strings. Drop them into a Show Text node (or the new text preview widgets) and read. There's no model output to wire into a sampler, because nothing is generated.
Where this pays off
If you're deciding whether to merge two checkpoints, this is the diagnostic you want before pulling the trigger. It also shines for checking whether a "fine-tune" you downloaded is actually a derivative of a base you own, or for hunting down which block of a model a fork changed. It's from the Model Utility Toolkit pack (silveroxides/ComfyUI-ModelUtils) - a toolbox that also includes the CWB merger nodes this report is designed to feed, so the two halves of the pack fit together.
Install
Everything in the pack installs at once. ComfyUI Manager → "Install Custom Nodes" → search Model Utility Toolkit (repo silveroxides/ComfyUI-ModelUtils), or clone by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-ModelUtils
Then restart ComfyUI. The one real dependency is unifiedefficientloader (UEL), the low-memory streaming library every node here uses; Manager installs it, but it's the thing to check if something errors at load. The pack's requirements.txt also lists requests, Pillow, mutagen, and av - those serve the pack's downloader/metadata nodes, not the analysis ones, so you can ignore them here.
One gotcha: the pack is built on ComfyUI's newer extension API, so keep ComfyUI itself current. On a stale core, these nodes may not show up at all.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| execution_mode | COMBO | ANALYZE streams both files and produces standard and CWB diagnostic reports. DOCUMENTATION ONLY performs no model loading. | |
| model_a | COMBO | First file in the comparison. Reports identify values and keys unique to this input separately from Model B. | |
| model_b | COMBO | Second file in the comparison. Inputs are analyzed only; neither file is modified or merged. | |
| top_weight_differences | INT | 200–1000 | Number of largest individual absolute parameter differences retained for the detailed report. Zero disables this list. |
| process_device | COMBO | Device for per-work-unit floating-point analysis. A CUDA OOM retries only the affected unit on CPU. | |
| force_clear_cache | BOOLEAN | true | Run garbage collection and clear the CUDA allocator cache after every analyzed work unit. Saves retained memory but slows analysis. |
| exclude_patterns | STRING | One pattern per line. Matching tensors are excluded from all comparison metrics and topology counts. Uses regex unless Glob Patterns is enabled. | |
| glob_patterns | BOOLEAN | false | Interpret exclusion entries as shell-style glob patterns instead of regular expressions. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| comparison_report | STRING | — |
| cwb_report | STRING | — |
| documentation | STRING | — |