Linoy Tsaban commited on
Commit
9cd1904
1 Parent(s): 50ba64c

Update app.py

Browse files

hide reconstructed image if input image change

Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -264,7 +264,9 @@ with gr.Blocks(css='style.css') as demo:
264
 
265
  def show_reconstruction():
266
  return ddpm_edited_image.update(visible=True)
267
-
 
 
268
 
269
  def reset_do_inversion():
270
  do_inversion = True
@@ -430,6 +432,9 @@ with gr.Blocks(css='style.css') as demo:
430
  fn = hide_reconstruction_button,
431
  outputs = [reconstruct_button],
432
  queue=False).then(
 
 
 
433
  fn=load_and_invert,
434
  inputs=[input_image,
435
  do_inversion,
 
264
 
265
  def show_reconstruction():
266
  return ddpm_edited_image.update(visible=True)
267
+
268
+ def hide_reconstruction():
269
+ return ddpm_edited_image.update(visible=False)
270
 
271
  def reset_do_inversion():
272
  do_inversion = True
 
432
  fn = hide_reconstruction_button,
433
  outputs = [reconstruct_button],
434
  queue=False).then(
435
+ fn = hide_reconstruction,
436
+ outputs=[ddpm_edited_image],
437
+ queue=False).then(
438
  fn=load_and_invert,
439
  inputs=[input_image,
440
  do_inversion,