fix lcm enable/disable bug
This commit is contained in:
parent
47d2b1dcb7
commit
803b68d210
@ -181,11 +181,16 @@ class ModelManager:
|
|||||||
lcm_lora_loaded = bool(self.model.model.get_list_adapters())
|
lcm_lora_loaded = bool(self.model.model.get_list_adapters())
|
||||||
if config.sd_lcm_lora:
|
if config.sd_lcm_lora:
|
||||||
if not lcm_lora_loaded:
|
if not lcm_lora_loaded:
|
||||||
|
logger.info("Load LCM LORA")
|
||||||
self.model.model.load_lora_weights(
|
self.model.model.load_lora_weights(
|
||||||
self.model.lcm_lora_id,
|
self.model.lcm_lora_id,
|
||||||
weight_name="pytorch_lora_weights.safetensors",
|
weight_name="pytorch_lora_weights.safetensors",
|
||||||
local_files_only=is_local_files_only(),
|
local_files_only=is_local_files_only(),
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
logger.info("Enable LCM LORA")
|
||||||
|
self.model.model.enable_lora()
|
||||||
else:
|
else:
|
||||||
if lcm_lora_loaded:
|
if lcm_lora_loaded:
|
||||||
|
logger.info("Disable LCM LORA")
|
||||||
self.model.model.disable_lora()
|
self.model.model.disable_lora()
|
||||||
|
Loading…
Reference in New Issue
Block a user