Linoy Tsaban
commited on
Commit
•
c8c4b36
1
Parent(s):
1c66b3f
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ def invert(x0, prompt_src="", num_diffusion_steps=100, cfg_scale_src = 3.5, eta
|
|
22 |
sd_pipe.scheduler.set_timesteps(num_diffusion_steps)
|
23 |
|
24 |
# vae encode image
|
25 |
-
w0 = (sd_pipe.vae.encode(x0).latent_dist.mode() * 0.18215).float()
|
26 |
|
27 |
# find Zs and wts - forward process
|
28 |
wt, zs, wts = inversion_forward_process(sd_pipe, w0, etas=eta, prompt=prompt_src, cfg_scale=cfg_scale_src, prog_bar=True, num_inference_steps=num_diffusion_steps)
|
|
|
22 |
sd_pipe.scheduler.set_timesteps(num_diffusion_steps)
|
23 |
|
24 |
# vae encode image
|
25 |
+
w0 = (sd_pipe.vae.encode(pil_to_tensor(x0).astype(torch.float16)).latent_dist.mode() * 0.18215).float()
|
26 |
|
27 |
# find Zs and wts - forward process
|
28 |
wt, zs, wts = inversion_forward_process(sd_pipe, w0, etas=eta, prompt=prompt_src, cfg_scale=cfg_scale_src, prog_bar=True, num_inference_steps=num_diffusion_steps)
|