From 8ed3d36eaf56aca06105f6fb3f82a32e88bf3f80 Mon Sep 17 00:00:00 2001 From: Dijkstra Date: Mon, 20 Nov 2023 18:11:23 +0100 Subject: [PATCH] fix: tags were never pulled from civitai the first time they were requested --- utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/utils.py b/utils.py index 4a2f8bd..2120327 100644 --- a/utils.py +++ b/utils.py @@ -103,21 +103,21 @@ def load_and_save_tags(lora_name, force_fetch): output_tags_list = [] lora_path = folder_paths.get_full_path("loras", lora_name) - if lora_tags is None or force_fetch: # search on civitai only if no local cache or forced - print("calculating lora hash") + if lora_tags is None or force_fetch or output_tags is None: # search on civitai only if no local cache or forced + print("[Lora-Auto-Trigger] calculating lora hash") LORAsha256 = calculate_sha256(lora_path) - print("requesting infos") + print("[Lora-Auto-Trigger] requesting infos") model_info = get_model_version_info(LORAsha256) if model_info is not None: if "trainedWords" in model_info: - print("tags found!") + print("[Lora-Auto-Trigger] tags found!") if lora_tags is None: lora_tags = {} lora_tags[lora_name] = model_info["trainedWords"] - save_dict_to_json(lora_tags,json_tags_path) + save_dict_to_json(lora_tags, json_tags_path) output_tags_list = model_info["trainedWords"] else: - print("No informations found.") + print("[Lora-Auto-Trigger] No informations found.") if lora_tags is None: lora_tags = {} lora_tags[lora_name] = []