Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,16 +51,17 @@ with open('loras.json', 'r') as f:
|
|
| 51 |
#torch.cuda.empty_cache()
|
| 52 |
#pipe = diffusers.ZImagePipeline.from_pretrained("dimitribarbot/Z-Image-Turbo-BF16", torch_dtype=torch.bfloat16)
|
| 53 |
#pipe = diffusers.ZImagePipeline.from_pretrained("AlekseyCalvin/Z_Image_Deturbo_Diffusers", torch_dtype=torch.bfloat16)
|
| 54 |
-
|
| 55 |
-
text_encoder = Qwen3ForCausalLM.from_pretrained(
|
| 56 |
pipeline = ZImagePipeline.from_pretrained(
|
| 57 |
'AlekseyCalvin/Z-Image-Deturbo-Returbo-Base_Diffusers',
|
| 58 |
text_encoder=text_encoder,
|
|
|
|
| 59 |
torch_dtype=torch.bfloat16
|
| 60 |
)
|
| 61 |
|
| 62 |
#pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=torch.float16).to("cuda")
|
| 63 |
-
|
| 64 |
|
| 65 |
#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)
|
| 66 |
|
|
|
|
| 51 |
#torch.cuda.empty_cache()
|
| 52 |
#pipe = diffusers.ZImagePipeline.from_pretrained("dimitribarbot/Z-Image-Turbo-BF16", torch_dtype=torch.bfloat16)
|
| 53 |
#pipe = diffusers.ZImagePipeline.from_pretrained("AlekseyCalvin/Z_Image_Deturbo_Diffusers", torch_dtype=torch.bfloat16)
|
| 54 |
+
vae = AutoencoderKL.from_pretrained("AlekseyCalvin/Custom_VAE-Z-image-FLUX.1-by-G-REPA", torch_dtype=torch.bfloat16, device_map="cuda")
|
| 55 |
+
text_encoder = Qwen3ForCausalLM.from_pretrained('Qwen/Qwen3-4B-Instruct-2507').to(torch.bfloat16)
|
| 56 |
pipeline = ZImagePipeline.from_pretrained(
|
| 57 |
'AlekseyCalvin/Z-Image-Deturbo-Returbo-Base_Diffusers',
|
| 58 |
text_encoder=text_encoder,
|
| 59 |
+
vae=vae,
|
| 60 |
torch_dtype=torch.bfloat16
|
| 61 |
)
|
| 62 |
|
| 63 |
#pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=torch.float16).to("cuda")
|
| 64 |
+
pipe.vae = AutoencoderKL.from_pretrained("AlekseyCalvin/Custom_VAE-Z-image-FLUX.1-by-G-REPA", torch_dtype=torch.bfloat16, device_map="cuda")
|
| 65 |
|
| 66 |
#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)
|
| 67 |
|