Imgutils Compare (CCIP)
'Is This the Same Character?' — CCIP Identity Comparison
- image_a
- image_b
- label
- distance
Here's the question every anime character-LoRA workflow eventually asks: "does this output actually look like the character I trained it on?" Eyeballing it works until you're doing it a hundred times. Imgutils Compare (CCIP) is the automated answer - it compares two images and tells you how similar they are as the same character, returning a label and a distance score. Lower distance = more similar.
Why it's worth having
The KB's character-consistency material keeps returning to one hard problem: identity is hard to verify at volume. CCIP is a character-identity comparison model - it's been trained to recognize "same anime character across different poses, outfits, and styles," which is a different notion of similarity than "same picture" or even "same person." That makes it the right tool for a few genuinely useful jobs:
- Dataset QA. Before you train a character LoRA, check that your collected images are actually all the same character - one distance check against your best reference and the impostors float to the top.
- Output verification. After generation, gate on whether the result matches the target identity.
- Deduplication. Drop near-identical images from a training set by identity rather than by pixel hash.
How it works
It wraps ccip_difference from imgutils. Both images are encoded into an identity embedding space and the distance between them is computed; the node then maps that distance to a human label. The mapping, straight from the source:
< 0.10→ "exact"< 0.25→ "very similar"< 0.40→ "similar"< 0.60→ "different"< 0.80→ "very different"- else → "opposite"
The interface
image_a,image_b- the two images to compare.- Outputs:
label(STRING) anddistance(FLOAT, lower = more similar).
No knobs, no threshold input - you're expected to gate on distance yourself. Pair it with Imgutils Score Threshold (which turns a score >= threshold into a boolean) or a manual threshold to build "same character: yes/no."
Honest take
Treat CCIP as a strong heuristic, not a verdict. Same character in a wildly different style can register as merely "similar"; two visually-identical-looking but actually distinct characters can read as "the same." The distance is a relative signal - calibrate your own cutoff on your own characters before trusting an absolute label. First use downloads the CCIP vision model from HF Hub (cached in ~/.cache/huggingface/hub/); after that it's a quick embedding comparison. And note the sibling LPIPS node in this pack compares perceptual pixel similarity - CCIP is the identity one, and they answer different questions.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/xiaden/comfyui-imgutils.git
cd comfyui-imgutils
pip install -r requirements.txt
Or via ComfyUI Manager (search "imgutils"). Needs ComfyUI >= 0.25.0 and Python >= 3.10; dependency is dghs-imgutils[gpu].
Troubleshooting
Identical images returning something other than "exact"? Check you're not comparing a downscaled thumbnail against full-res - extreme resolution gaps skew embeddings. If two characters you know are different come back "similar," that's the model's style-blind spot, not a bug - raise your threshold for "different." And the first run will sit for a moment while the model downloads; that's expected, give it the cache folder.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image_a | IMAGE | First image to compare. | |
| image_b | IMAGE | Second image for comparison. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| label | STRING | — |
| distance | FLOAT | — |