Spaces:
Runtime error
Runtime error
Commit
•
74364bb
1
Parent(s):
31116fd
Update app.py
Browse files
app.py
CHANGED
@@ -215,8 +215,7 @@ def merge_incompatible_lora(full_path_lora, lora_scale):
|
|
215 |
|
216 |
def run_lora(face_image, prompt, negative, lora_scale, selected_state, sdxl_loras, sdxl_loras_new, progress=gr.Progress(track_tqdm=True)):
|
217 |
global last_lora, last_merged, last_fused, pipe
|
218 |
-
|
219 |
-
face_info = app.get(cv2.cvtColor(face_image, cv2.COLOR_RGB2BGR))
|
220 |
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
|
221 |
face_emb = face_info['embedding']
|
222 |
face_kps = draw_kps(face_image, face_info['kps'])
|
@@ -303,7 +302,7 @@ with gr.Blocks(css="custom.css") as demo:
|
|
303 |
selected_state = gr.State()
|
304 |
with gr.Row(elem_id="main_app"):
|
305 |
with gr.Group(elem_id="gallery_box"):
|
306 |
-
photo = gr.Image(label="Upload a picture of yourself", interactive=True)
|
307 |
selected_loras = gr.Gallery(label="Selected LoRAs", height=80, show_share_button=False, visible=False, elem_id="gallery_selected", )
|
308 |
order_gallery = gr.Radio(choices=["random", "likes"], value="random", label="Order by", elem_id="order_radio")
|
309 |
new_gallery = gr.Gallery(label="New LoRAs", elem_id="gallery_new", columns=3, value=[(item["image"], item["title"]) for item in sdxl_loras_raw_new], allow_preview=False, show_share_button=False)
|
|
|
215 |
|
216 |
def run_lora(face_image, prompt, negative, lora_scale, selected_state, sdxl_loras, sdxl_loras_new, progress=gr.Progress(track_tqdm=True)):
|
217 |
global last_lora, last_merged, last_fused, pipe
|
218 |
+
face_info = app.get(cv2.cvtColor(np.array(face_image)), cv2.COLOR_RGB2BGR))
|
|
|
219 |
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
|
220 |
face_emb = face_info['embedding']
|
221 |
face_kps = draw_kps(face_image, face_info['kps'])
|
|
|
302 |
selected_state = gr.State()
|
303 |
with gr.Row(elem_id="main_app"):
|
304 |
with gr.Group(elem_id="gallery_box"):
|
305 |
+
photo = gr.Image(label="Upload a picture of yourself", interactive=True, type="pil")
|
306 |
selected_loras = gr.Gallery(label="Selected LoRAs", height=80, show_share_button=False, visible=False, elem_id="gallery_selected", )
|
307 |
order_gallery = gr.Radio(choices=["random", "likes"], value="random", label="Order by", elem_id="order_radio")
|
308 |
new_gallery = gr.Gallery(label="New LoRAs", elem_id="gallery_new", columns=3, value=[(item["image"], item["title"]) for item in sdxl_loras_raw_new], allow_preview=False, show_share_button=False)
|