Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -202,7 +202,7 @@ def infer(
|
|
202 |
generated_image_tensor = torch.tensor([np.array(sd_image).transpose(2, 0, 1)]).to('cuda') / 255.0
|
203 |
# Encode the generated image into latents
|
204 |
with torch.no_grad():
|
205 |
-
generated_latents = vae.encode(generated_image_tensor.to(torch.bfloat16)).latent_dist.sample().mul_(0.18215)
|
206 |
latent_path = f"sd35m_{seed}.pt"
|
207 |
# Save the latents to a .pt file
|
208 |
torch.save(generated_latents, latent_path)
|
|
|
202 |
generated_image_tensor = torch.tensor([np.array(sd_image).transpose(2, 0, 1)]).to('cuda') / 255.0
|
203 |
# Encode the generated image into latents
|
204 |
with torch.no_grad():
|
205 |
+
generated_latents = pipe.vae.encode(generated_image_tensor.to(torch.bfloat16)).latent_dist.sample().mul_(0.18215)
|
206 |
latent_path = f"sd35m_{seed}.pt"
|
207 |
# Save the latents to a .pt file
|
208 |
torch.save(generated_latents, latent_path)
|