1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 23:14:49 +08:00

Add arguments to run the VAE in fp16 or bf16 for testing.

This commit is contained in:
comfyanonymous
2023-07-06 18:04:28 -04:00
parent f5232c4869
commit e7bee85df8
4 changed files with 21 additions and 7 deletions

View File

@@ -366,6 +366,14 @@ def vae_offload_device():
else:
return torch.device("cpu")
def vae_dtype():
if args.fp16_vae:
return torch.float16
elif args.bf16_vae:
return torch.bfloat16
else:
return torch.float32
def get_autocast_device(dev):
if hasattr(dev, 'type'):
return dev.type