This commit is contained in:
lllyasviel
2023-10-14 02:57:41 -07:00
committed by GitHub
parent 6f24c03826
commit ed69bea3e3
11 changed files with 51 additions and 114 deletions
@@ -448,6 +448,13 @@ def unet_inital_load_device(parameters, dtype):
else:
return cpu_dev
def unet_dtype(device=None, model_params=0):
if args.bf16_unet:
return torch.bfloat16
if should_use_fp16(device=device, model_params=model_params):
return torch.float16
return torch.float32
def text_encoder_offload_device():
if args.gpu_only:
return get_torch_device()