diff options
author | xeonvs <xeonvs@gmail.com> | 2022-09-07 16:09:30 +0000 |
---|---|---|
committer | xeonvs <xeonvs@gmail.com> | 2022-09-07 16:09:30 +0000 |
commit | aaeeef82fa61f719cd5a2590423a99bd1229d5f1 (patch) | |
tree | d31ed7c909556891dde45695c1782247b74db85d /modules | |
parent | 65fbefd0337f9deb913c6956a9cfe2155c9c2f5b (diff) | |
download | stable-diffusion-webui-gfx803-aaeeef82fa61f719cd5a2590423a99bd1229d5f1.tar.gz stable-diffusion-webui-gfx803-aaeeef82fa61f719cd5a2590423a99bd1229d5f1.tar.bz2 stable-diffusion-webui-gfx803-aaeeef82fa61f719cd5a2590423a99bd1229d5f1.zip |
Miss device type for option --medvram
Diffstat (limited to 'modules')
-rw-r--r-- | modules/lowvram.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/lowvram.py b/modules/lowvram.py index 4b78deab..bd117491 100644 --- a/modules/lowvram.py +++ b/modules/lowvram.py @@ -2,9 +2,12 @@ import torch module_in_gpu = None
cpu = torch.device("cpu")
-gpu = torch.device("cuda")
-device = gpu if torch.cuda.is_available() else 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")
def setup_for_low_vram(sd_model, use_medvram):
parents = {}
|