ford442 commited on
Commit
2d10cf0
·
verified ·
1 Parent(s): c7abc95

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -189,7 +189,7 @@ def infer(
189
  generated_image_tensor = torch.tensor([np.array(sd_image).transpose(2, 0, 1)]).to('cuda') / 255.0
190
  # Encode the generated image into latents
191
  with torch.no_grad():
192
- generated_latents = vae.encode(generated_image_tensor).latent_dist.sample().mul_(0.18215)
193
  latent_path = f"sd35m_{seed}.pt"
194
  # Save the latents to a .pt file
195
  torch.save(generated_latents, latent_path)
 
189
  generated_image_tensor = torch.tensor([np.array(sd_image).transpose(2, 0, 1)]).to('cuda') / 255.0
190
  # Encode the generated image into latents
191
  with torch.no_grad():
192
+ generated_latents = vae.encode(generated_image_tensor.to(torch.bfloat16)).latent_dist.sample().mul_(0.18215)
193
  latent_path = f"sd35m_{seed}.pt"
194
  # Save the latents to a .pt file
195
  torch.save(generated_latents, latent_path)