Compare commits

...
Author SHA1 Message Date
Dijkstra 763152c041 chore: set clip strength to 0 when there is no CLIP. (just in case) 2024-10-31 19:51:46 +01:00
Dijkstra c85b302a61 chore: CLIP is not optional in the LoraLoaderVanilla and LoraLoaderAdvanced 2024-10-31 19:49:13 +01:00
Dijkstra 6484968fbe Merge pull request #35 from idrirap/dev/issue34
fix: sometimes the preview image extension is prefixed with '.preview'
2024-10-31 19:15:58 +01:00
Dijkstra 9a212d13e7 fix: sometimes the preview image extension is prefixed with '.preview' 2024-10-31 19:14:31 +01:00
Dijkstra b02bea5480 chore: bump version + added MIT license 2024-06-20 17:56:49 +02:00
Dijkstra 8c4b7941a6 chore: improved description 2024-06-20 17:50:07 +02:00
dijkstra 070751dbf1 Merge pull request #24 from idrirap/dev/add_registryId
feat: set publisherId
2024-06-20 17:35:06 +02:00
Dijkstra 41f6277830 feat: set publisherId 2024-06-20 17:34:27 +02:00
dijkstra 03ddfbfe66 Merge pull request #21 from haohaocreates/publish
Add Github Action for Publishing to Comfy Registry
2024-06-20 17:28:55 +02:00
dijkstra 885a1c8371 Merge pull request #22 from haohaocreates/pyproject
Add pyproject.toml for Custom Node Registry
2024-06-20 17:28:45 +02:00
haohaocreates 8656b2ebaf chore(pyproject): Add pyproject.toml for Custom Node Registry 2024-05-22 17:25:44 -04:00
haohaocreates c3759e7b30 chore(publish): Add Github Action for Publishing to Comfy Registry 2024-05-22 17:25:41 -04:00
Dijkstra 236e230515 doc: added trigger explanation 2024-04-09 22:35:48 +02:00
dijkstra 23ef04b1cb Merge pull request #20 from idrirap/update_readme
Update readme
2024-04-09 22:18:38 +02:00
6 changed files with 57 additions and 9 deletions
+21
View File
@@ -0,0 +1,21 @@
name: Publish to Comfy registry
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "pyproject.toml"
jobs:
publish-node:
name: Publish Custom Node to registry
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Publish Custom Node
uses: Comfy-Org/publish-node-action@main
with:
## Add your own personal access token to your Github Repository secrets and reference it here.
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
+7
View File
@@ -16,6 +16,13 @@ They get their vanilla equivalents with less features
Overall, Custom-Scripts is recommended to be able to know the content of the tag lists with the node `showText` Overall, Custom-Scripts is recommended to be able to know the content of the tag lists with the node `showText`
## Features ## Features
### Lora Trigger Words
Lora trigger words are imported from two sources :
- Civitai api (only for civitai models)
![image](./images/CivitaiTriggerWords.png)
- Model training metadata (when available)
#### Vanilla vs Advanced #### Vanilla vs Advanced
> Vanilla refers to nodes that have no lora preview from the menu, nor the lora list. But the features provided are the same. > Vanilla refers to nodes that have no lora preview from the menu, nor the lora list. But the features provided are the same.
Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

+8 -5
View File
@@ -14,7 +14,6 @@ class LoraLoaderVanilla:
return { return {
"required": { "required": {
"model": ("MODEL",), "model": ("MODEL",),
"clip": ("CLIP", ),
"lora_name": (LORA_LIST, ), "lora_name": (LORA_LIST, ),
"strength_model": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}), "strength_model": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
"strength_clip": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}), "strength_clip": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
@@ -22,6 +21,7 @@ class LoraLoaderVanilla:
"append_loraname_if_empty": ("BOOLEAN", {"default": False}), "append_loraname_if_empty": ("BOOLEAN", {"default": False}),
}, },
"optional": { "optional": {
"clip": ("CLIP", ),
"override_lora_name":("STRING", {"forceInput": True}), "override_lora_name":("STRING", {"forceInput": True}),
} }
} }
@@ -31,7 +31,9 @@ class LoraLoaderVanilla:
FUNCTION = "load_lora" FUNCTION = "load_lora"
CATEGORY = "autotrigger" CATEGORY = "autotrigger"
def load_lora(self, model, clip, lora_name, strength_model, strength_clip, force_fetch, append_loraname_if_empty, override_lora_name=""): def load_lora(self, model, lora_name, strength_model, strength_clip, force_fetch, append_loraname_if_empty, clip=None, override_lora_name=""):
if clip is None:
strength_clip=0
if override_lora_name != "": if override_lora_name != "":
lora_name = override_lora_name lora_name = override_lora_name
meta_tags_list = sort_tags_by_frequency(get_metadata(lora_name, "loras")) meta_tags_list = sort_tags_by_frequency(get_metadata(lora_name, "loras"))
@@ -109,7 +111,6 @@ class LoraLoaderAdvanced:
return { return {
"required": { "required": {
"model": ("MODEL",), "model": ("MODEL",),
"clip": ("CLIP", ),
"lora_name": (LORA_LIST, ), "lora_name": (LORA_LIST, ),
"strength_model": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}), "strength_model": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
"strength_clip": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}), "strength_clip": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
@@ -118,6 +119,7 @@ class LoraLoaderAdvanced:
"append_loraname_if_empty": ("BOOLEAN", {"default": False}), "append_loraname_if_empty": ("BOOLEAN", {"default": False}),
}, },
"optional": { "optional": {
"clip": ("CLIP", ),
"override_lora_name":("STRING", {"forceInput": True}), "override_lora_name":("STRING", {"forceInput": True}),
} }
} }
@@ -127,7 +129,9 @@ class LoraLoaderAdvanced:
FUNCTION = "load_lora" FUNCTION = "load_lora"
CATEGORY = "autotrigger" CATEGORY = "autotrigger"
def load_lora(self, model, clip, lora_name, strength_model, strength_clip, force_fetch, enable_preview, append_loraname_if_empty, override_lora_name=""): def load_lora(self, model, lora_name, strength_model, strength_clip, force_fetch, enable_preview, append_loraname_if_empty, clip=None, override_lora_name=""):
if clip is None:
strength_clip=0
if override_lora_name != "": if override_lora_name != "":
has_preview, prev = get_preview_path(override_lora_name, "loras") has_preview, prev = get_preview_path(override_lora_name, "loras")
prev = f"loras/{prev}" if has_preview else None prev = f"loras/{prev}" if has_preview else None
@@ -253,7 +257,6 @@ class LoraTagsOnly:
return (civitai_tags_list, meta_tags_list) return (civitai_tags_list, meta_tags_list)
# A dictionary that contains all nodes you want to export with their names # A dictionary that contains all nodes you want to export with their names
# NOTE: names should be globally unique # NOTE: names should be globally unique
NODE_CLASS_MAPPINGS = { NODE_CLASS_MAPPINGS = {
+14
View File
@@ -0,0 +1,14 @@
[project]
name = "comfyui-lora-auto-trigger-words"
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.3"
license = "MIT"
[project.urls]
Repository = "https://github.com/idrirap/ComfyUI-Lora-Auto-Trigger-Words"
# Used by Comfy Registry https://comfyregistry.org
[tool.comfy]
PublisherId = "dijkstra"
DisplayName = "ComfyUI-Lora-Auto-Trigger-Words"
Icon = ""
+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