Linoy Tsaban commited on
Commit
27ec4ac
1 Parent(s): d0c1ebf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -131,6 +131,7 @@ def reconstruct(tar_prompt,
131
  # if do_reconstruction:
132
  reconstruction = sample(zs.value, wts.value, prompt_tar=tar_prompt, skip=skip, cfg_scale_tar=tar_cfg_scale)
133
  return reconstruction
 
134
 
135
  def load_and_invert(
136
  input_image,
@@ -258,6 +259,9 @@ with gr.Blocks(css='style.css') as demo:
258
 
259
  def show_reconstruction_option():
260
  return reconstruct_button.update(visible=True)
 
 
 
261
 
262
 
263
  def reset_do_inversion():
@@ -371,6 +375,9 @@ with gr.Blocks(css='style.css') as demo:
371
  outputs= [row2, row3, add_concept_button, sega_concepts_counter], queue = False)
372
 
373
  reconstruct_button.click(
 
 
 
374
  fn = reconstruct,
375
  inputs = [tar_prompt,
376
  tar_cfg_scale,
 
131
  # if do_reconstruction:
132
  reconstruction = sample(zs.value, wts.value, prompt_tar=tar_prompt, skip=skip, cfg_scale_tar=tar_cfg_scale)
133
  return reconstruction
134
+
135
 
136
  def load_and_invert(
137
  input_image,
 
259
 
260
  def show_reconstruction_option():
261
  return reconstruct_button.update(visible=True)
262
+
263
+ def show_reconstruction():
264
+ return ddpm_edited_image.update(visible=True)
265
 
266
 
267
  def reset_do_inversion():
 
375
  outputs= [row2, row3, add_concept_button, sega_concepts_counter], queue = False)
376
 
377
  reconstruct_button.click(
378
+ fn = show_reconstruction,
379
+ outputs = [ddpm_edited_image]
380
+ ).then(
381
  fn = reconstruct,
382
  inputs = [tar_prompt,
383
  tar_cfg_scale,