From 3c4d9f313dd9b5f504d88856174d49e6c1659cc6 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Wed, 21 Aug 2024 23:46:54 +0300 Subject: [PATCH] Change vae cast order --- modules/processing_vae.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/processing_vae.py b/modules/processing_vae.py index dd4174d02..e5108f0d3 100644 --- a/modules/processing_vae.py +++ b/modules/processing_vae.py @@ -45,10 +45,10 @@ def full_vae_decode(latents, model): if upcast: # this is done by diffusers automatically if output_type != 'latent' model.upcast_vae() - if shared.opts.no_half_vae: - latents = latents.to(torch.float32) - elif getattr(model.vae, "post_quant_conv", None) is not None: + if getattr(model.vae, "post_quant_conv", None) is not None: latents = latents.to(next(iter(model.vae.post_quant_conv.parameters())).dtype) + elif shared.opts.no_half_vae: + latents = latents.to(torch.float32) # normalize latents latents_mean = model.vae.config.get("latents_mean", None)