multimodalart HF staff commited on
Commit
2c247b9
1 Parent(s): cd63d48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -167,7 +167,8 @@ def update_selection(selected_state: gr.SelectData, sdxl_loras, face_strength, i
167
  selected_state
168
  )
169
 
170
- def center_crop_image_as_square(img):
 
171
  square_size = min(img.size)
172
 
173
  left = (img.width - square_size) / 2
@@ -205,8 +206,9 @@ def merge_incompatible_lora(full_path_lora, lora_scale):
205
  del lora_model
206
  gc.collect()
207
 
208
- def run_lora(face_image, prompt, negative, lora_scale, selected_state, face_strength, image_strength, guidance_scale, depth_control_scale, sdxl_loras, progress=gr.Progress(track_tqdm=True)):
209
  global last_lora, last_merged, last_fused, pipe
 
210
  face_info = app.get(cv2.cvtColor(np.array(face_image), cv2.COLOR_RGB2BGR))
211
  face_info = sorted(face_info, key=lambda x:(x['bbox'][2]-x['bbox'][0])*x['bbox'][3]-x['bbox'][1])[-1] # only use the maximum face
212
  face_emb = face_info['embedding']
 
167
  selected_state
168
  )
169
 
170
+ def center_crop_image_as_square(images):
171
+ img = images[0]
172
  square_size = min(img.size)
173
 
174
  left = (img.width - square_size) / 2
 
206
  del lora_model
207
  gc.collect()
208
 
209
+ def run_lora(images, prompt, negative, lora_scale, selected_state, face_strength, image_strength, guidance_scale, depth_control_scale, sdxl_loras, progress=gr.Progress(track_tqdm=True)):
210
  global last_lora, last_merged, last_fused, pipe
211
+ face_image = images[0]
212
  face_info = app.get(cv2.cvtColor(np.array(face_image), cv2.COLOR_RGB2BGR))
213
  face_info = sorted(face_info, key=lambda x:(x['bbox'][2]-x['bbox'][0])*x['bbox'][3]-x['bbox'][1])[-1] # only use the maximum face
214
  face_emb = face_info['embedding']