Spaces:
Runtime error
Runtime error
Update src/pipelines/instantid_pipeline.py
Browse files
src/pipelines/instantid_pipeline.py
CHANGED
@@ -380,7 +380,7 @@ class InstantidMultiConceptPipeline(StableDiffusionXLControlNetPipeline):
|
|
380 |
image_embedding_list = get_face_embedding(face_app, ref_images)
|
381 |
image_prompt_image_emb_list = []
|
382 |
for image_embeds in image_embedding_list:
|
383 |
-
prompt_image_emb = concept_models._encode_prompt_image_emb(image_embeds
|
384 |
concept_models._execution_device,
|
385 |
num_images_per_prompt,
|
386 |
concept_models.unet.dtype,
|
@@ -763,6 +763,6 @@ def get_face_embedding(face_app, ref_images):
|
|
763 |
face_info = face_app.get(cv2.cvtColor(np.array(face_image), cv2.COLOR_RGB2BGR))
|
764 |
face_info = sorted(face_info, key=lambda x: (x['bbox'][2] - x['bbox'][0]) * x['bbox'][3] - x['bbox'][1])[0] # only use the maximum face
|
765 |
face_emb = face_info['embedding']
|
766 |
-
emb_list.append(face_emb)
|
767 |
# face_kps = draw_kps(face_image, face_info['kps'])
|
768 |
return emb_list
|
|
|
380 |
image_embedding_list = get_face_embedding(face_app, ref_images)
|
381 |
image_prompt_image_emb_list = []
|
382 |
for image_embeds in image_embedding_list:
|
383 |
+
prompt_image_emb = concept_models._encode_prompt_image_emb(image_embeds,
|
384 |
concept_models._execution_device,
|
385 |
num_images_per_prompt,
|
386 |
concept_models.unet.dtype,
|
|
|
763 |
face_info = face_app.get(cv2.cvtColor(np.array(face_image), cv2.COLOR_RGB2BGR))
|
764 |
face_info = sorted(face_info, key=lambda x: (x['bbox'][2] - x['bbox'][0]) * x['bbox'][3] - x['bbox'][1])[0] # only use the maximum face
|
765 |
face_emb = face_info['embedding']
|
766 |
+
emb_list.append(face_emb.cuda())
|
767 |
# face_kps = draw_kps(face_image, face_info['kps'])
|
768 |
return emb_list
|