This extension uses DLib or InsightFace to calculate the vicinity between two faces and to perform other operation on faces.
https://github.com/cubiq/ComfyUI_FaceAnalysis
git clone https://github.com/cubiq/ComfyUI_FaceAnalysis
comfy node install comfyui_faceanalysis