KseniaAI commited on
Commit
4a06cb9
β€’
1 Parent(s): a873f15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -60,7 +60,7 @@ def generate_image(images, prompt, negative_prompt, preserve_face_structure, fac
60
  for image in images:
61
  face = cv2.imread(image)
62
  faces = app.get(face)
63
- faceid_embed = torch.from_numpy(faces[0].normed_embedding).unsqueeze(0)
64
  faceid_all_embeds.append(faceid_embed)
65
  if(first_iteration and preserve_face_structure):
66
  face_image = face_align.norm_crop(face, landmark=faces[0].kps, image_size=224) # you can also segment the face
 
60
  for image in images:
61
  face = cv2.imread(image)
62
  faces = app.get(face)
63
+ faceid_embed = torch.from_numpy(faces[0].normed_embedding).unsqueeze(0).to(dtype=torch.float32) # Ensure embedding dtype matches model dtype
64
  faceid_all_embeds.append(faceid_embed)
65
  if(first_iteration and preserve_face_structure):
66
  face_image = face_align.norm_crop(face, landmark=faces[0].kps, image_size=224) # you can also segment the face