Nodes/ComfyUI-Pixel-Forge/Image Similarity (RESNET)
ComfyUI Node

Image Similarity (RESNET)

The Same Matching Brain, But a ResNet Does the Seeing

By ThunderBolt4931·Created 12 months ago·Updated 9 months ago· 6
Image Similarity (RESNET)
  • image_ref
  • image_batch
  • batch_masks
  • batch_blank_masks
  • bounding_boxes
  • matched_images
  • matched_masks
  • matched_blank_masks
  • matched_bounding_boxes
  • is_similar_list
  • similarities_list
resnet_modelresnet50
threshold0.70

"Image Similarity (RESNET)" is the sibling of Image Similarity (Sequential CLIP) in the Pixel-Forge pack: same job, same greedy matching logic, but the "eyes" are a torchvision ResNet trained on ImageNet instead of a CLIP text-aligned encoder. If you read that node's article, skip straight to "what's different" - the structure is identical.

What's the same

Same required inputs: image_ref, image_batch, and the mask/blank-mask/bounding-box trio that pins it to the Crop Disjoint Mask Regions pipeline. Same sequential behavior - references processed one at a time, each grabbing the best remaining candidate by cosine similarity, no candidate matched twice, below-threshold results replaced with black images and zeroed masks to keep the batch aligned. Same matched_* outputs in reference order. The only new knob is resnet_model, which picks the backbone:

  • resnet_model (enum, default resnet50) - one of resnet18, resnet34, resnet50, resnet101, resnet152. The model loads from torchvision's ImageNet weights and swaps only when you change it (it caches per-name, so switching models isn't a constant reload).
  • threshold (FLOAT, default 0.7) - the cosine-similarity bar. Note the default is a touch more lenient than the CLIP node's 0.8, which reflects that ResNet similarities land differently.

The outputs are the quartet of matched_images, matched_masks, matched_blank_masks, matched_bounding_boxes plus two strings - but they're named differently here: is_similar_list (True/False per reference) and similarities_list (the scores). Slightly nicer for downstream logic than the CLIP node's raw scores.

CLIP or ResNet - which do you actually want?

This is the real question, and there's a genuine difference. CLIP was trained to align images with text, so it's tuned for semantic similarity - "does this look like it depicts the same subject." ResNet was trained for plain ImageNet classification, so its features are about texture, edges, shape, and visual structure, with zero text bias. For matching crops that are near-duplicates or visually related (same physical object, same lighting), ResNet cosine similarity tends to be steadier and less surprised by abstract semantics. For "is this the same kind of thing as my reference," CLIP usually wins.

Neither is a precision instrument - both are one embedding per image and a dot product. Also note this node doesn't compute LPIPS like the CLIP variant; you get cosine similarity alone, so its is_similar_list is a single criterion rather than a two-metric verdict.

Load and install

The ResNet weights download from torchvision on first use (resnet50 is roughly 100 MB) - lighter than the CLIP node's open_clip + LPIPS combo, and it reuses whatever you already have cached if you've used torchvision models before. Install is the standard pack dance:

cd ComfyUI/custom_nodes
git clone https://github.com/ThunderBolt4931/comfyui_pixel_forge

then restart, or search "ComfyUI-Pixel-Forge" in ComfyUI Manager. It shows up under a menu whose name is worth a raised eyebrow - the category string in the source is Pixel-Forger/Utils, a typo of the pack's usual Pixel-Forge. Cosmetic, but it's the kind of loose end you'll find all over this brand-new pack (December 2025, zero community footprint, README that documents none of the nodes). Expect a few sharp edges and verify its pairings by eye on anything that matters.

CategoryPixel-Forger/Utils

Inputs (7)

NameTypeDefaultDescription
image_refIMAGE
image_batchIMAGE
batch_masksMASK
batch_blank_masksMASK
bounding_boxesBOX
resnet_modelCOMBOresnet505 options: resnet18, resnet34, resnet50, resnet101, resnet152
thresholdFLOAT0.700–1

Outputs (6)

NameTypeDescription
matched_imagesIMAGE
matched_masksMASK
matched_blank_masksMASK
matched_bounding_boxesBOX
is_similar_listSTRING
similarities_listSTRING