diff --git a/extensions-builtin/Lora/lora_patches.py b/extensions-builtin/Lora/lora_patches.py index 7085d251b..12986e8f9 100644 --- a/extensions-builtin/Lora/lora_patches.py +++ b/extensions-builtin/Lora/lora_patches.py @@ -2,6 +2,7 @@ import torch import networks from modules import patches, shared + class LoraPatches: def __init__(self): self.active = False diff --git a/modules/devices.py b/modules/devices.py index 1102b9a74..78a20c4e6 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -134,7 +134,7 @@ def torch_gc(force=False): if oom > previous_oom: previous_oom = oom log.warning(f'GPU out-of-memory error: {mem}') - if used > shared.opts.torch_gc_threshold: + if used >= shared.opts.torch_gc_threshold: log.info(f'GPU high memory utilization: {used}% {mem}') force = True if not force: diff --git a/modules/shared.py b/modules/shared.py index 259b04e34..04a03d9b4 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -300,7 +300,7 @@ options_templates.update(options_section(('cuda', "Compute Settings"), { "other_sep": OptionInfo("

Execution precision

", "", gr.HTML), "opt_channelslast": OptionInfo(False, "Use channels last as torch memory format "), "cudnn_benchmark": OptionInfo(False, "Enable full-depth cuDNN benchmark feature"), - "torch_gc_threshold": OptionInfo(90, "VRAM usage threshold before running Torch GC to clear up VRAM", gr.Slider, {"minimum": 0, "maximum": 100, "step": 1}), + "torch_gc_threshold": OptionInfo(80 if devices.backend == "ipex" else 90, "VRAM usage threshold before running Torch GC to clear up VRAM", gr.Slider, {"minimum": 0, "maximum": 100, "step": 1}), "cuda_compile_sep": OptionInfo("

Model Compile

", "", gr.HTML), "cuda_compile": OptionInfo(True if cmd_opts.use_openvino else False, "Compile UNet"),