From a1a06004d8b05d54a4f0997e96be446b15657cbd Mon Sep 17 00:00:00 2001 From: Qing Date: Mon, 8 Jan 2024 21:49:27 +0800 Subject: [PATCH] fix lcm_lora load --- iopaint/model_manager.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iopaint/model_manager.py b/iopaint/model_manager.py index 89c91f0..b009320 100644 --- a/iopaint/model_manager.py +++ b/iopaint/model_manager.py @@ -166,8 +166,11 @@ class ModelManager: def enable_disable_lcm_lora(self, config: InpaintRequest): if self.available_models[self.name].support_lcm_lora: + # TODO: change this if load other lora is supported + lcm_lora_loaded = bool(self.model.model.get_list_adapters()) if config.sd_lcm_lora: - if not self.model.model.get_list_adapters(): + if not lcm_lora_loaded: self.model.model.load_lora_weights(self.model.lcm_lora_id) else: - self.model.model.disable_lora() + if lcm_lora_loaded: + self.model.model.disable_lora()