diff options
author | brkirch <brkirch@users.noreply.github.com> | 2023-02-01 14:28:16 +0000 |
---|---|---|
committer | brkirch <brkirch@users.noreply.github.com> | 2023-02-01 19:05:56 +0000 |
commit | 1b8af15f13cba2bfce249d9837660ea4f28d451e (patch) | |
tree | d961d858e70941197701982cc92e6c18b3e76816 /modules/shared.py | |
parent | 226d840e84c5f306350b0681945989b86760e616 (diff) | |
download | stable-diffusion-webui-gfx803-1b8af15f13cba2bfce249d9837660ea4f28d451e.tar.gz stable-diffusion-webui-gfx803-1b8af15f13cba2bfce249d9837660ea4f28d451e.tar.bz2 stable-diffusion-webui-gfx803-1b8af15f13cba2bfce249d9837660ea4f28d451e.zip |
Refactor Mac specific code to a separate file
Move most Mac related code to a separate file, don't even load it unless web UI is run under macOS.
Diffstat (limited to 'modules/shared.py')
-rw-r--r-- | modules/shared.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/shared.py b/modules/shared.py index 5600d480..59f12cd8 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -145,6 +145,9 @@ devices.device, devices.device_interrogate, devices.device_gfpgan, devices.devic (devices.cpu if any(y in cmd_opts.use_cpu for y in [x, 'all']) else devices.get_optimal_device() for x in ['sd', 'interrogate', 'gfpgan', 'esrgan', 'codeformer'])
device = devices.device
+if sys.platform == "darwin": + from modules import mac_specific
+ mac_specific.device = device
weight_load_location = None if cmd_opts.lowram else "cpu"
batch_cond_uncond = cmd_opts.always_batch_cond_uncond or not (cmd_opts.lowvram or cmd_opts.medvram)
|