Nodes/comfyui_cv/CV Match Features (Model)
ComfyUI Node

CV Match Features (Model)

Matches two sets of keypoints+descriptors using an ONNX matcher model (LightGlue family) via cv2.dnn. All .onnx files in models/onnx (including subdirectories) are listed — pick the matcher that matches your extractor (e.g. lightglue/disk_lightglue.onnx for DISK features). Outputs follow the standard feature infrastructure: cv2.DMatch list for 'CV Draw Matches', Nx1x2 point arrays for 'CV Find Homography (RANSAC)'. LightGlue reads keypoints in a normalized frame centred on the image, and the exported ONNX does NOT do that conversion itself - this node does it, from the sizes on 'space_a'/'space_b' when they are wired, or from the keypoints' own extent when they are not (the reference implementation's own fallback). Zero matches is a valid result (empty outputs, not an error).

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Match Features (Model)
  • keypoints_a
  • descriptors_a
  • keypoints_b
  • descriptors_b
  • space_a
  • space_b
  • matches
  • points_a
  • points_b
  • scores
  • match_count
model
engineauto (default engine)
Categoryimage/CV/dnn

Inputs (8)

NameTypeDefaultDescription
keypoints_aCV_KEYPOINTSKeypoints of image A (from 'CV Feature Extract (Model)').
descriptors_aNPARRAYDescriptors of image A, paired with keypoints_a.
keypoints_bCV_KEYPOINTSKeypoints of image B (from 'CV Feature Extract (Model)').
descriptors_bNPARRAYDescriptors of image B, paired with keypoints_b.
modelCOMBOONNX matcher model from models/onnx (e.g. lightglue/disk_lightglue.onnx).
space_aoptNPARRAY,IMAGE,MASK,LATENTImage A itself - only its height/width are read, to normalize keypoints_a the way LightGlue expects. Leave unconnected to infer the size from the keypoints' own extent instead.
space_boptNPARRAY,IMAGE,MASK,LATENTImage B itself - only its height/width are read, to normalize keypoints_b. Leave unconnected to infer the size from the keypoints' own extent instead.
engineoptCOMBOauto (default engine)DNN engine for inference.

Outputs (5)

NameTypeDescription
matchesCV_MATCHEScv2.DMatch list sorted best-first.
points_aNPARRAY(M, 1, 2) float32 matched point coordinates in A.
points_bNPARRAY(M, 1, 2) float32 matched point coordinates in B.
scoresNPARRAY(M,) float32 match confidence scores.
match_countINTNumber of matches found.