From 9fbba692975de4be48c62af079048a110cccf4bf Mon Sep 17 00:00:00 2001 From: Haoming <73768377+Haoming02@users.noreply.github.com> Date: Thu, 5 Dec 2024 19:33:35 +0800 Subject: [PATCH] Fix LivePreview not working with fp8 UNet (#2412) * fix dtype --- modules/devices.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/devices.py b/modules/devices.py index 0bda9325..f8daafc0 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -54,7 +54,7 @@ device_interrogate: torch.device = memory_management.text_encoder_device() # fo device_gfpgan: torch.device = memory_management.get_torch_device() # will be managed by memory management system device_esrgan: torch.device = memory_management.get_torch_device() # will be managed by memory management system device_codeformer: torch.device = memory_management.get_torch_device() # will be managed by memory management system -dtype: torch.dtype = memory_management.unet_dtype() +dtype: torch.dtype = torch.float32 if memory_management.unet_dtype() is torch.float32 else torch.float16 dtype_vae: torch.dtype = memory_management.vae_dtype() dtype_unet: torch.dtype = memory_management.unet_dtype() dtype_inference: torch.dtype = memory_management.unet_dtype()