Skip to content

Commit

Permalink
small bug fix if multiple kps images are provided
Browse files Browse the repository at this point in the history
  • Loading branch information
matt3o committed Feb 23, 2024
1 parent 54729bf commit f9c20ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion InstantID.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def apply_instantid(self, instantid, insightface, control_net, image, model, pos
if face_embed is None:
raise Exception('Reference Image: No face detected.')

face_kps = extractFeatures(insightface, image_kps if image_kps is not None else image, extract_kps=True)
face_kps = extractFeatures(insightface, image_kps[0].unsqueeze(0) if image_kps is not None else image[0].unsqueeze(0), extract_kps=True)

if face_kps is None:
face_kps = torch.zeros_like(image) if image_kps is None else image_kps
Expand Down

0 comments on commit f9c20ad

Please sign in to comment.