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

--gpu-only now keeps the VAE on the device.

This commit is contained in:
comfyanonymous
2023-07-01 15:22:40 -04:00
parent ce35d8c659
commit 1c1b0e7299
2 changed files with 15 additions and 5 deletions

View File

@@ -349,6 +349,15 @@ def text_encoder_device():
else:
return torch.device("cpu")
def vae_device():
return get_torch_device()
def vae_offload_device():
if args.gpu_only or vram_state == VRAMState.SHARED:
return get_torch_device()
else:
return torch.device("cpu")
def get_autocast_device(dev):
if hasattr(dev, 'type'):
return dev.type