From 9d1642fd0bad0752fa6f4bf8fd28f07770c90377 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Thu, 14 Mar 2024 23:34:44 +0300 Subject: [PATCH] Fix NNCF with Lora --- extensions-builtin/Lora/networks.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions-builtin/Lora/networks.py b/extensions-builtin/Lora/networks.py index 64ec2b74d..bb6eaa12a 100644 --- a/extensions-builtin/Lora/networks.py +++ b/extensions-builtin/Lora/networks.py @@ -229,7 +229,11 @@ def load_networks(names, te_multipliers=None, unet_multipliers=None, dyn_dims=No if recompile_model: shared.log.info("LoRA recompiling model") backup_lora_model = shared.compiled_model_state.lora_model - sd_models_compile.compile_diffusers(shared.sd_model) + if shared.opts.cuda_compile: + shared.sd_model = sd_models_compile.compile_diffusers(shared.sd_model) + if shared.opts.nncf_compress_weights: + shared.sd_model = sd_models_compile.nncf_compress_weights(shared.sd_model) + shared.compiled_model_state.lora_model = backup_lora_model