AlekseyCalvin commited on
Commit
df56a3f
·
verified ·
1 Parent(s): 35fb723

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -50,7 +50,16 @@ with open('loras.json', 'r') as f:
50
  pipe = diffusers.ZImagePipeline.from_pretrained("dimitribarbot/Z-Image-Turbo-BF16", torch_dtype=torch.bfloat16)
51
 
52
  #pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=torch.float16).to("cuda")
53
- pipe.vae = AutoencoderKL.from_pretrained("AlekseyCalvin/AnimeVAE_by_Anzhc_for_Flux_ZiT", torch_dtype=torch.bfloat16, device_map="cuda")
 
 
 
 
 
 
 
 
 
54
  device = "cuda" if torch.cuda.is_available() else "cpu"
55
 
56
 
 
50
  pipe = diffusers.ZImagePipeline.from_pretrained("dimitribarbot/Z-Image-Turbo-BF16", torch_dtype=torch.bfloat16)
51
 
52
  #pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=torch.float16).to("cuda")
53
+ #pipe.vae = AutoencoderKL.from_pretrained("AlekseyCalvin/AnimeVAE_by_Anzhc_for_Flux_ZiT", torch_dtype=torch.bfloat16, device_map="cuda")
54
+
55
+ custom_vae = AutoencoderKL.from_pretrained(
56
+ "AlekseyCalvin/AnimeVAE_by_Anzhc_for_Flux_ZiT",
57
+ torch_dtype=torch.float32,
58
+ device_map=None # Do not use device_map here
59
+ )
60
+
61
+ # Manually move the VAE to the correct device (e.g., "cuda")
62
+ pipe.vae = custom_vae.to("cuda")
63
  device = "cuda" if torch.cuda.is_available() else "cpu"
64
 
65