diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-11 07:25:02 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-11 07:25:02 +0000 |
commit | 2e6153e343e5002b5c161d00a43453400be2d884 (patch) | |
tree | efbca339024e4d8aec5abd81c2ed45e6f33b0a17 /modules/lowvram.py | |
parent | a094b3ab8e4adf300725f8b567c0fd787e9d039a (diff) | |
parent | b5d1af11b7dc718d4d91d379c75e46f4bd2e2fe6 (diff) | |
download | stable-diffusion-webui-gfx803-2e6153e343e5002b5c161d00a43453400be2d884.tar.gz stable-diffusion-webui-gfx803-2e6153e343e5002b5c161d00a43453400be2d884.tar.bz2 stable-diffusion-webui-gfx803-2e6153e343e5002b5c161d00a43453400be2d884.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'modules/lowvram.py')
-rw-r--r-- | modules/lowvram.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/modules/lowvram.py b/modules/lowvram.py index bd117491..079386c3 100644 --- a/modules/lowvram.py +++ b/modules/lowvram.py @@ -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 = {}
|