Spaces:
Running
on
A10G
Running
on
A10G
Linoy Tsaban
commited on
Commit
·
f0a34a7
1
Parent(s):
97bf037
Update app.py
Browse files
app.py
CHANGED
@@ -121,6 +121,13 @@ with gr.Blocks(css='style.css') as demo:
|
|
121 |
if not wt:
|
122 |
# invert and retrieve noise maps and latent
|
123 |
wt, zs, wts = invert(x0 =x0 , prompt_src=src_prompt, num_diffusion_steps=steps, cfg_scale_src=cfg_scale_src)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
output = sample(wt, zs, wts, prompt_tar=tar_prompt, cfg_scale_tar=cfg_scale_tar, skip=skip)
|
126 |
|
|
|
121 |
if not wt:
|
122 |
# invert and retrieve noise maps and latent
|
123 |
wt, zs, wts = invert(x0 =x0 , prompt_src=src_prompt, num_diffusion_steps=steps, cfg_scale_src=cfg_scale_src)
|
124 |
+
# vae decode image
|
125 |
+
with autocast("cuda"), inference_mode():
|
126 |
+
x0_dec = sd_pipe.vae.decode(1 / 0.18215 * x0).sample
|
127 |
+
if x0_dec.dim()<4:
|
128 |
+
x0_dec = x0_dec[None,:,:,:]
|
129 |
+
img = image_grid(x0_dec)
|
130 |
+
return img
|
131 |
|
132 |
output = sample(wt, zs, wts, prompt_tar=tar_prompt, cfg_scale_tar=cfg_scale_tar, skip=skip)
|
133 |
|