mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-04 03:10:21 +00:00
Modular device management
This commit is contained in:

committed by
AUTOMATIC1111

parent
065e310a3f
commit
b5d1af11b7
@@ -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 = {}
|
||||
|
Reference in New Issue
Block a user