Skip to content

Commit

Permalink
Fix faceid (#2727)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Apr 1, 2024
1 parent e421081 commit eb451a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal_controlnet/external_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def is_animate_diff_batch(self) -> bool:
def uses_clip(self) -> bool:
"""Whether this unit uses clip preprocessor."""
return any((
("ip-adapter" in self.module and "faceid" not in self.module),
("ip-adapter" in self.module and "face_id" not in self.module),
self.module in ("clip_vision", "revision_clipvision", "revision_ignore_prompt"),
))

Expand Down
2 changes: 1 addition & 1 deletion scripts/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ def load_model(self):

def run_model(self, img: np.ndarray, **kwargs) -> Tuple[torch.Tensor, bool]:
self.load_model()
img = HWC3(img)
assert img.shape[2] == 3, f"Expect RGB channels, but get {img.shape}"
faces = self.model.get(img)
if not faces:
raise Exception("Insightface: No face found in image.")
Expand Down

0 comments on commit eb451a0

Please sign in to comment.