Modular device management

This commit is contained in:
Abdullah Barhoum
2022-09-11 07:11:27 +02:00
committed by AUTOMATIC1111
parent 065e310a3f
commit b5d1af11b7
4 changed files with 19 additions and 13 deletions

View File

@@ -1,13 +1,9 @@
import torch
from modules.devices import get_optimal_device
module_in_gpu = None
cpu = torch.device("cpu")
if torch.has_cuda:
device = gpu = torch.device("cuda")
elif torch.has_mps:
device = gpu = torch.device("mps")
else:
device = gpu = torch.device("cpu")
device = gpu = get_optimal_device()
def setup_for_low_vram(sd_model, use_medvram):
parents = {}