diff options
Diffstat (limited to 'modules/devices.py')
-rw-r--r-- | modules/devices.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/devices.py b/modules/devices.py index 12aab665..0158b11f 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -2,9 +2,9 @@ import contextlib import torch -# has_mps is only available in nightly pytorch (for now), `getattr` for compatibility from modules import errors +# has_mps is only available in nightly pytorch (for now), `getattr` for compatibility has_mps = getattr(torch, 'has_mps', False) cpu = torch.device("cpu") @@ -34,8 +34,7 @@ def enable_tf32(): errors.run(enable_tf32, "Enabling TF32") -device = get_optimal_device() -device_codeformer = cpu if has_mps else device +device = device_gfpgan = device_bsrgan = device_esrgan = device_scunet = device_codeformer = get_optimal_device() dtype = torch.float16 def randn(seed, shape): |