Compare commits

...
2 changed files with 10 additions and 7 deletions
+3 -3
View File
@@ -1,8 +1,8 @@
[project] [project]
name = "comfyui-lora-auto-trigger-words" name = "comfyui-lora-auto-trigger-words"
description = "This project is a fork of [a/https://github.com/Extraltodeus/LoadLoraWithTags](https://github.com/Extraltodeus/LoadLoraWithTags) The aim of these custom nodes is to get an easy access to the tags used to trigger a lora." description = "The aim of these custom nodes is to get an easy access to the tags used to trigger a lora / lycoris. Extract the tags from civitai or from the safetensors metadatas when available."
version = "1.0.0" version = "1.0.2"
license = "LICENSE" license = "MIT"
[project.urls] [project.urls]
Repository = "https://github.com/idrirap/ComfyUI-Lora-Auto-Trigger-Words" Repository = "https://github.com/idrirap/ComfyUI-Lora-Auto-Trigger-Words"
+7 -4
View File
@@ -15,11 +15,14 @@ def get_preview_path(name, type):
file_path_no_ext = os.path.splitext(file_path)[0] file_path_no_ext = os.path.splitext(file_path)[0]
item_image=None item_image=None
for ext in ["png", "jpg", "jpeg", "preview.png"]: for ext in ["png", "jpg", "jpeg", "gif"]:
has_image = os.path.isfile(file_path_no_ext + "." + ext) if item_image is not None:
if has_image:
item_image = f"{file_name}.{ext}"
break break
for ext2 in ["", ".preview"]:
has_image = os.path.isfile(file_path_no_ext + ext2 + "." + ext)
if has_image:
item_image = f"{file_name}{ext2}.{ext}"
break
return has_image, item_image return has_image, item_image