Spaces:
Running
on
A10G
Running
on
A10G
Linoy Tsaban
commited on
Commit
•
805da8d
1
Parent(s):
4f4effc
Update app.py
Browse files
app.py
CHANGED
@@ -131,14 +131,7 @@ def reconstruct(tar_prompt,
|
|
131 |
if image_caption.lower() == tar_prompt.lower(): # if image caption was not changed, run actual reconstruction
|
132 |
tar_prompt = ""
|
133 |
latnets = wts.value[-1].expand(1, -1, -1, -1)
|
134 |
-
reconstruction_img =
|
135 |
-
init_latents=latnets,
|
136 |
-
guidance_scale = tar_cfg_scale,
|
137 |
-
# num_images_per_prompt=1,
|
138 |
-
# num_inference_steps=steps,
|
139 |
-
# use_ddpm=True,
|
140 |
-
# wts=wts.value,
|
141 |
-
zs=zs.value).images[0]
|
142 |
reconstruction = gr.State(value=reconstruction_img)
|
143 |
do_reconstruction = False
|
144 |
return reconstruction.value, reconstruction, ddpm_edited_image.update(visible=True), do_reconstruction, "Hide Reconstruction"
|
@@ -258,7 +251,7 @@ def edit(input_image,
|
|
258 |
else: # if sega concepts were not added, performs regular ddpm sampling
|
259 |
|
260 |
if do_reconstruction: # if ddpm sampling wasn't computed
|
261 |
-
pure_ddpm_img = sample(zs
|
262 |
reconstruction = gr.State(value=pure_ddpm_img)
|
263 |
do_reconstruction = False
|
264 |
return pure_ddpm_img, reconstruct_button.update(visible=False), do_reconstruction, reconstruction, wts, zs, do_inversion, show_share_button
|
|
|
131 |
if image_caption.lower() == tar_prompt.lower(): # if image caption was not changed, run actual reconstruction
|
132 |
tar_prompt = ""
|
133 |
latnets = wts.value[-1].expand(1, -1, -1, -1)
|
134 |
+
reconstruction_img = sample(zs, wts, prompt_tar=tar_prompt, skip=skip, cfg_scale_tar=tar_cfg_scale)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
reconstruction = gr.State(value=reconstruction_img)
|
136 |
do_reconstruction = False
|
137 |
return reconstruction.value, reconstruction, ddpm_edited_image.update(visible=True), do_reconstruction, "Hide Reconstruction"
|
|
|
251 |
else: # if sega concepts were not added, performs regular ddpm sampling
|
252 |
|
253 |
if do_reconstruction: # if ddpm sampling wasn't computed
|
254 |
+
pure_ddpm_img = sample(zs, wts, prompt_tar=tar_prompt, skip=skip, cfg_scale_tar=tar_cfg_scale)
|
255 |
reconstruction = gr.State(value=pure_ddpm_img)
|
256 |
do_reconstruction = False
|
257 |
return pure_ddpm_img, reconstruct_button.update(visible=False), do_reconstruction, reconstruction, wts, zs, do_inversion, show_share_button
|