diff options
author | Sj-Si <sjw.jetty@gmail.com> | 2024-01-11 21:37:35 +0000 |
---|---|---|
committer | Sj-Si <sjw.jetty@gmail.com> | 2024-01-11 21:37:35 +0000 |
commit | 036500223de0a3caaa86360a8ad3ed301e4367b0 (patch) | |
tree | f05f0d5fc503d9c35d57bad077a5dab1dfd6569e /modules/shared_init.py | |
parent | 0726a6e12e85a37d1e514f5603acf9f058c11783 (diff) | |
parent | cb5b335acddd126d4f6c990982816c06beb0d6ae (diff) | |
download | stable-diffusion-webui-gfx803-036500223de0a3caaa86360a8ad3ed301e4367b0.tar.gz stable-diffusion-webui-gfx803-036500223de0a3caaa86360a8ad3ed301e4367b0.tar.bz2 stable-diffusion-webui-gfx803-036500223de0a3caaa86360a8ad3ed301e4367b0.zip |
Merge changes from dev
Diffstat (limited to 'modules/shared_init.py')
-rw-r--r-- | modules/shared_init.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/shared_init.py b/modules/shared_init.py index d3fb687e..935e3a21 100644 --- a/modules/shared_init.py +++ b/modules/shared_init.py @@ -18,8 +18,10 @@ def initialize(): shared.options_templates = shared_options.options_templates
shared.opts = options.Options(shared_options.options_templates, shared_options.restricted_opts)
shared.restricted_opts = shared_options.restricted_opts
- if os.path.exists(shared.config_filename):
+ try:
shared.opts.load(shared.config_filename)
+ except FileNotFoundError:
+ pass
from modules import devices
devices.device, devices.device_interrogate, devices.device_gfpgan, devices.device_esrgan, devices.device_codeformer = \
@@ -27,6 +29,7 @@ def initialize(): devices.dtype = torch.float32 if cmd_opts.no_half else torch.float16
devices.dtype_vae = torch.float32 if cmd_opts.no_half or cmd_opts.no_half_vae else torch.float16
+ devices.dtype_inference = torch.float32 if cmd_opts.precision == 'full' else devices.dtype
shared.device = devices.device
shared.weight_load_location = None if cmd_opts.lowram else "cpu"
|