fix model lookups

This commit is contained in:
Vladimir Mandic
2023-08-27 08:01:29 +00:00
parent 8de8f85c61
commit 48c0ce9b2b
3 changed files with 3 additions and 5 deletions
+1 -2
View File
@@ -73,8 +73,7 @@ def torch_gc(force=False):
if backend == "directml":
practical_used = round(100 * torch.cuda.memory_allocated() / (1 << 30) / gpu.get('total', 1))
shared.log.info(f'Practical GPU memory utilization: {practical_used}%')
if shared.opts.disable_gc and not force:
if not force:
return
collected = gc.collect()
if cuda_ok:
+2 -2
View File
@@ -491,7 +491,7 @@ class ModelData:
self.lock = threading.Lock()
def get_sd_model(self):
if self.sd_model is None:
if self.sd_model is None and shared.opts.sd_model_checkpoint != 'None':
with self.lock:
try:
if shared.backend == shared.Backend.ORIGINAL:
@@ -511,7 +511,7 @@ class ModelData:
self.sd_model = v
def get_sd_refiner(self):
if self.sd_refiner is None:
if self.sd_refiner is None and shared.opts.sd_model_refiner != 'None':
with self.lock:
try:
if shared.backend == shared.Backend.ORIGINAL:
-1
View File
@@ -398,7 +398,6 @@ options_templates.update(options_section(('cuda', "Compute Settings"), {
"cuda_compile_precompile": OptionInfo(False, "Model compile precompile"),
"cuda_compile_verbose": OptionInfo(False, "Model compile verbose mode"),
"cuda_compile_errors": OptionInfo(True, "Model compile suppress errors"),
"disable_gc": OptionInfo(True, "Disable Torch memory garbage collection"),
"ipex_optimize": OptionInfo(True if devices.backend == "ipex" else False, "Enable IPEX Optimize for Intel GPUs"),
"directml_memory_provider": OptionInfo(default_memory_provider, '[DirectML] Memory stats provider', gr.Dropdown, lambda: {"choices": memory_providers}),
}))