From 599ff8a6f20a07232b3a2e054384608577ccd088 Mon Sep 17 00:00:00 2001 From: DominikDoom Date: Sat, 22 Jul 2023 17:52:51 +0200 Subject: [PATCH] Don't load lycos if they point to the same path as loras E.g. when using --lyco-patch-lora to replace built-in Loras. Prevents duplicate entries. --- scripts/tag_autocomplete_helper.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/tag_autocomplete_helper.py b/scripts/tag_autocomplete_helper.py index 00cd432..628c8a4 100644 --- a/scripts/tag_autocomplete_helper.py +++ b/scripts/tag_autocomplete_helper.py @@ -263,15 +263,19 @@ def write_temp_files(): if model_keyword_installed: load_hash_cache() - if LORA_PATH is not None and LORA_PATH.exists(): + lora_exists = LORA_PATH is not None and LORA_PATH.exists() + if lora_exists: lora = get_lora() if lora: write_to_temp_file('lora.txt', lora) - - if LYCO_PATH is not None and LYCO_PATH.exists(): + + lyco_exists = LYCO_PATH is not None and LYCO_PATH.exists() + if lyco_exists and not (lora_exists and LYCO_PATH.samefile(LORA_PATH)): lyco = get_lyco() if lyco: write_to_temp_file('lyco.txt', lyco) + elif lyco_exists and lora_exists and LYCO_PATH.samefile(LORA_PATH): + print("tag_autocomplete_helper: LyCORIS path is the same as LORA path, skipping") if model_keyword_installed: update_hash_cache()