Avoid unnecessary isfile/exists calls

This commit is contained in:
Aarni Koskela
2024-01-04 00:16:58 +02:00
parent e4dcdcc955
commit d9034b48a5
10 changed files with 41 additions and 35 deletions

View File

@@ -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 = \