yanze commited on
Commit
632f63f
1 Parent(s): 3efa982

Update pulid/pipeline_flux.py

Browse files
Files changed (1) hide show
  1. pulid/pipeline_flux.py +3 -3
pulid/pipeline_flux.py CHANGED
@@ -117,8 +117,8 @@ class PuLIDPipeline(nn.Module):
117
  self.debug_img_list = []
118
  image_bgr = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
119
  # get antelopev2 embedding
120
- for k in self.app.models.keys():
121
- self.app.models[k].session.set_providers(['CUDAExecutionProvider'])
122
  face_info = self.app.get(image_bgr)
123
  if len(face_info) > 0:
124
  face_info = sorted(face_info, key=lambda x: (x['bbox'][2] - x['bbox'][0]) * (x['bbox'][3] - x['bbox'][1]))[
@@ -144,7 +144,7 @@ class PuLIDPipeline(nn.Module):
144
  # incase insightface didn't detect face
145
  if id_ante_embedding is None:
146
  print('fail to detect face using insightface, extract embedding on align face')
147
- self.handler_ante.session.set_providers(['CUDAExecutionProvider'])
148
  id_ante_embedding = self.handler_ante.get_feat(align_face)
149
 
150
  id_ante_embedding = torch.from_numpy(id_ante_embedding).to(self.device, self.weight_dtype)
 
117
  self.debug_img_list = []
118
  image_bgr = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
119
  # get antelopev2 embedding
120
+ # for k in self.app.models.keys():
121
+ # self.app.models[k].session.set_providers(['CUDAExecutionProvider'])
122
  face_info = self.app.get(image_bgr)
123
  if len(face_info) > 0:
124
  face_info = sorted(face_info, key=lambda x: (x['bbox'][2] - x['bbox'][0]) * (x['bbox'][3] - x['bbox'][1]))[
 
144
  # incase insightface didn't detect face
145
  if id_ante_embedding is None:
146
  print('fail to detect face using insightface, extract embedding on align face')
147
+ # self.handler_ante.session.set_providers(['CUDAExecutionProvider'])
148
  id_ante_embedding = self.handler_ante.get_feat(align_face)
149
 
150
  id_ante_embedding = torch.from_numpy(id_ante_embedding).to(self.device, self.weight_dtype)