Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -50,18 +50,12 @@ 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 |
-
|
| 54 |
|
| 55 |
-
custom_vae = AutoencoderKL.from_pretrained(
|
| 56 |
-
"AlekseyCalvin/AnimeVAE_by_Anzhc_for_Flux_ZiT",
|
| 57 |
-
torch_dtype=torch.float32,
|
| 58 |
-
ignore_mismatched_sizes=True,
|
| 59 |
-
low_cpu_mem_usage=False,
|
| 60 |
-
device_map=None # Do not use device_map here
|
| 61 |
-
)
|
| 62 |
|
| 63 |
# Manually move the VAE to the correct device (e.g., "cuda")
|
| 64 |
-
pipe.vae = custom_vae.to("cuda")
|
| 65 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 66 |
|
| 67 |
|
|
|
|
| 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/Custom_VAE-Z-image-FLUX.1-by-G-REPA", torch_dtype=torch.bfloat16, device_map="cuda")
|
| 54 |
|
| 55 |
+
#custom_vae = AutoencoderKL.from_pretrained("AlekseyCalvin/AnimeVAE_by_Anzhc_for_Flux_ZiT", torch_dtype=torch.float32, ignore_mismatched_sizes=True, low_cpu_mem_usage=False, device_map=None)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
# Manually move the VAE to the correct device (e.g., "cuda")
|
| 58 |
+
#pipe.vae = custom_vae.to("cuda")
|
| 59 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 60 |
|
| 61 |
|