From 33a9c156ad02b045b5595c771e597cef1778ada8 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Sun, 16 Jun 2024 21:40:39 +0200 Subject: [PATCH] fix: do not apply loras more than one time when not using lora in prompt --- modules/util.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/util.py b/modules/util.py index 4506b392..cd18081b 100644 --- a/modules/util.py +++ b/modules/util.py @@ -390,6 +390,9 @@ def get_enabled_loras(loras: list, remove_none=True) -> list: def parse_lora_references_from_prompt(prompt: str, loras: List[Tuple[AnyStr, float]], loras_limit: int = 5, skip_file_check=False, prompt_cleanup=True, deduplicate_loras=True, lora_filenames=None) -> tuple[List[Tuple[AnyStr, float]], str]: + # prevent unintended side effects when returning without detection + loras = loras.copy() + if lora_filenames is None: lora_filenames = []