multimodalart HF staff commited on
Commit
a5120e3
1 Parent(s): 14f27cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -35,6 +35,9 @@ from controlnet_aux import ZoeDetector
35
  from compel import Compel, ReturnedEmbeddingsType
36
  import spaces
37
 
 
 
 
38
  #from gradio_imageslider import ImageSlider
39
 
40
  with open("sdxl_loras.json", "r") as file:
@@ -358,7 +361,7 @@ def run_lora(face_image, prompt, negative, lora_scale, selected_state, face_stre
358
 
359
  st = time.time()
360
  image = generate_image(prompt, negative, face_emb, face_image, face_kps, image_strength, guidance_scale, face_strength, depth_control_scale, repo_name, full_path_lora, lora_scale, sdxl_loras, selected_state_index, st)
361
- return image, gr.update(visible=True)
362
 
363
  def shuffle_gallery(sdxl_loras):
364
  random.shuffle(sdxl_loras)
@@ -523,8 +526,8 @@ with gr.Blocks(css="custom.css") as demo:
523
  with gr.Row():
524
  prompt = gr.Textbox(label="Prompt", show_label=False, lines=1, max_lines=1, info="Describe your subject (optional)", value="a person", elem_id="prompt")
525
  button = gr.Button("Run", elem_id="run_button")
526
- result = gr.Image(
527
- interactive=False, label="Generated Image", elem_id="result-image"
528
  )
529
  with gr.Group(elem_id="share-btn-container", visible=False) as share_group:
530
  community_icon = gr.HTML(community_icon_html)
 
35
  from compel import Compel, ReturnedEmbeddingsType
36
  import spaces
37
 
38
+ from gradio_imageslider import ImageSlider
39
+
40
+
41
  #from gradio_imageslider import ImageSlider
42
 
43
  with open("sdxl_loras.json", "r") as file:
 
361
 
362
  st = time.time()
363
  image = generate_image(prompt, negative, face_emb, face_image, face_kps, image_strength, guidance_scale, face_strength, depth_control_scale, repo_name, full_path_lora, lora_scale, sdxl_loras, selected_state_index, st)
364
+ return (face_image, image), gr.update(visible=True)
365
 
366
  def shuffle_gallery(sdxl_loras):
367
  random.shuffle(sdxl_loras)
 
526
  with gr.Row():
527
  prompt = gr.Textbox(label="Prompt", show_label=False, lines=1, max_lines=1, info="Describe your subject (optional)", value="a person", elem_id="prompt")
528
  button = gr.Button("Run", elem_id="run_button")
529
+ result = ImageSlider(
530
+ interactive=False, label="Generated Image", elem_id="result-image", position=0.1
531
  )
532
  with gr.Group(elem_id="share-btn-container", visible=False) as share_group:
533
  community_icon = gr.HTML(community_icon_html)