This commit is contained in:
Disty0
2023-08-22 10:39:38 +03:00
parent 12fd9151a7
commit 374307dd8a
3 changed files with 11 additions and 14 deletions
-12
View File
@@ -112,15 +112,3 @@ def get_cached_file_name(*args, model_hash_str, device, cache_root):
file_name = None
model_hash_str = None
return file_name
def openvino_override_opts():
from modules import shared
if not shared.opts.cuda_compile:
shared.log.warn("OpenVINO: Enabling Torch Compile")
shared.opts.cuda_compile = True
if shared.opts.cuda_compile_backend != "openvino_fx":
shared.log.warn("OpenVINO: Setting Torch Compiler backend to OpenVINO FX")
shared.opts.cuda_compile_backend = "openvino_fx"
if shared.opts.sd_backend != "diffusers":
shared.log.warn("OpenVINO: Setting backend to Diffusers")
shared.opts.sd_backend = "diffusers"
+2
View File
@@ -184,6 +184,8 @@ class State:
state = State()
state.server_start = time.time()
if not hasattr(cmd_opts, "use_openvino"):
cmd_opts.use_openvino = False
if cmd_opts.use_openvino:
backend = Backend.DIFFUSERS
cmd_opts.backend = 'diffusers'
+9 -2
View File
@@ -967,8 +967,15 @@ def create_ui(startup_timer = None):
if cmd_opts.use_directml:
directml_override_opts()
if cmd_opts.use_openvino:
from modules.intel.openvino import openvino_override_opts
openvino_override_opts()
if not modules.shared.opts.cuda_compile:
modules.shared.log.warn("OpenVINO: Enabling Torch Compile")
modules.shared.opts.cuda_compile = True
if modules.shared.opts.cuda_compile_backend != "openvino_fx":
modules.shared.log.warn("OpenVINO: Setting Torch Compiler backend to OpenVINO FX")
modules.shared.opts.cuda_compile_backend = "openvino_fx"
if modules.shared.opts.sd_backend != "diffusers":
modules.shared.log.warn("OpenVINO: Setting backend to Diffusers")
modules.shared.opts.sd_backend = "diffusers"
try:
opts.save(modules.shared.config_filename)
log.info(f'Settings changed: {len(changed)} {changed}')