Linoy Tsaban commited on
Commit
89ef3d2
1 Parent(s): 1f90a09

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -302,6 +302,10 @@ with gr.Blocks(css='style.css') as demo:
302
  def hide_inversion_progress():
303
  return inversion_progress.update(visible=False)
304
 
 
 
 
 
305
 
306
  gr.HTML(intro)
307
  wts = gr.State()
@@ -385,6 +389,7 @@ with gr.Blocks(css='style.css') as demo:
385
  run_button = gr.Button("Edit")
386
  reconstruct_button = gr.Button("Show Reconstruction", visible=False)
387
  hide_reconstruct_button = gr.Button("Hide Reconstruction", visible=False)
 
388
 
389
  with gr.Accordion("Advanced Options", open=False):
390
  with gr.Row():
@@ -465,6 +470,11 @@ with gr.Blocks(css='style.css') as demo:
465
  outputs = [ddpm_edited_image,reconstruction,do_reconstruction, reconstruct_button, hide_reconstruct_button]
466
  )
467
 
 
 
 
 
 
468
 
469
  # Automatically start inverting upon input_image change
470
  input_image.change(
 
302
  def hide_inversion_progress():
303
  return inversion_progress.update(visible=False)
304
 
305
+ def clear():
306
+ return "",ddpm_edited_image.update(visible=False), sega_edited_image.update(visible=False), reconstruct_button.update(visible=False), True
307
+
308
+
309
 
310
  gr.HTML(intro)
311
  wts = gr.State()
 
389
  run_button = gr.Button("Edit")
390
  reconstruct_button = gr.Button("Show Reconstruction", visible=False)
391
  hide_reconstruct_button = gr.Button("Hide Reconstruction", visible=False)
392
+ clear_button = gr.Button("Clear")
393
 
394
  with gr.Accordion("Advanced Options", open=False):
395
  with gr.Row():
 
470
  outputs = [ddpm_edited_image,reconstruction,do_reconstruction, reconstruct_button, hide_reconstruct_button]
471
  )
472
 
473
+ clear_button.click(
474
+ fn = clear,
475
+ outputs = [tar_prompt,ddpm_edited_image, sega_edited_image, reconstruct_button, do_reconstruction]
476
+ )
477
+
478
 
479
  # Automatically start inverting upon input_image change
480
  input_image.change(