ford442 commited on
Commit
87a8f58
·
verified ·
1 Parent(s): 6dee80d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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)