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.
This commit is contained in:
brkirch
2023-02-01 09:28:16 -05:00
parent 226d840e84
commit 1b8af15f13
4 changed files with 66 additions and 61 deletions

View File

@@ -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)