mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
fix model lookups
This commit is contained in:
+1
-2
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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}),
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user