Linoy Tsaban commited on
Commit
37ba0eb
1 Parent(s): 2e64364

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -416,7 +416,11 @@ with gr.Blocks(css="style.css") as demo:
416
  else:
417
  return inversion_progress.update(visible=False)
418
 
419
-
 
 
 
 
420
 
421
 
422
  gr.HTML(intro)
@@ -631,7 +635,7 @@ with gr.Blocks(css="style.css") as demo:
631
  #add_concept_button.click(fn = update_display_concept, inputs=sega_concepts_counter,
632
  # outputs= [row2, row2_advanced, row3, row3_advanced, add_concept_button, sega_concepts_counter], queue = False)
633
 
634
- run_button.click(fn = update_inversion_progress_visibility, inputs =[input_image,do_inversion], outputs=[inversion_progress],queue=False).then(
635
  fn=load_and_invert,
636
  inputs=[input_image,
637
  do_inversion,
@@ -645,7 +649,7 @@ with gr.Blocks(css="style.css") as demo:
645
  tar_cfg_scale
646
  ],
647
  outputs=[wts, zs, do_inversion, inversion_progress],
648
- ).then(fn = update_inversion_progress_visibility, inputs =[input_image,do_inversion], outputs=[inversion_progress],queue=False).success(
649
  fn=edit,
650
  inputs=[input_image,
651
  wts, zs,
 
416
  else:
417
  return inversion_progress.update(visible=False)
418
 
419
+ def update_edit_progress_visibility(input_image, do_inversion):
420
+ if do_inversion and not input_image is None:
421
+ return inversion_progress.update(visible=True, label="inverting...")
422
+ else:
423
+ return inversion_progress.update(visible=True, label="editing...")
424
 
425
 
426
  gr.HTML(intro)
 
635
  #add_concept_button.click(fn = update_display_concept, inputs=sega_concepts_counter,
636
  # outputs= [row2, row2_advanced, row3, row3_advanced, add_concept_button, sega_concepts_counter], queue = False)
637
 
638
+ run_button.click(fn = update_edit_progress_visibility, inputs =[input_image,do_inversion], outputs=[inversion_progress],queue=False).then(
639
  fn=load_and_invert,
640
  inputs=[input_image,
641
  do_inversion,
 
649
  tar_cfg_scale
650
  ],
651
  outputs=[wts, zs, do_inversion, inversion_progress],
652
+ ).then(fn = update_edit_progress_visibility, inputs =[input_image,do_inversion], outputs=[inversion_progress],queue=False).success(
653
  fn=edit,
654
  inputs=[input_image,
655
  wts, zs,