This commit is contained in:
Vladimir Mandic
2024-06-12 21:02:43 -04:00
parent 5f41181576
commit 6e01d510d4
41 changed files with 327666 additions and 44 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ def full_vae_decode(latents, model):
upcast = (model.vae.dtype == torch.float16) and getattr(model.vae.config, 'force_upcast', False) and hasattr(model, 'upcast_vae')
if upcast: # this is done by diffusers automatically if output_type != 'latent'
model.upcast_vae()
if hasattr(model.vae, "post_quant_conv"):
if getattr(model.vae, "post_quant_conv", None) is not None:
latents = latents.to(next(iter(model.vae.post_quant_conv.parameters())).dtype)
# normalize latents