Compare commits

...
12 Commits
Author SHA1 Message Date
Dr.Lt.Data 3fc749d6ba feat: Load Image Batch/List from Dir - sort_method is added
https://github.com/ltdrdata/ComfyUI-Inspire-Pack/issues/233
2025-06-17 22:05:16 +09:00
Dr.Lt.Data c2ccf7f879 Merge pull request #240 from LevelPixel/patch-1
Return an empty list from RetrieveBackendData rather than throwing a runtime error
2025-06-12 17:05:51 +09:00
Level Pixel 8e99bebdfe Update backend_support.py - Return an empty list rather than throwing a runtime error
Return an empty list rather than throwing a runtime error
2025-06-10 06:51:57 +06:00
Dr.Lt.Data 8814b8901a modified: support case-insensitive matching for prompt loader
https://github.com/ltdrdata/ComfyUI-Inspire-Pack/issues/239#issuecomment-2952226907
2025-06-09 06:30:31 +09:00
Dr.Lt.Data 291d3dd13f Merge pull request #230 from wzgrx/patch-1
Update requirements.txt
2025-05-17 16:57:27 +09:00
wzgrx 5619e51b01 Update requirements.txt 2025-05-17 09:28:41 +08:00
Dr.Lt.Data 0f38db4180 feat: support OSS scheduler based on Impact Sampler 2025-04-13 10:31:17 +09:00
Dr.Lt.Data e2d18c21ba feat: IPAdapterModelHelper - add SDXL FaceID Plus v2
https://github.com/ltdrdata/ComfyUI-Inspire-Pack/issues/224
2025-04-05 18:01:42 +09:00
Dr.Lt.Data 13fda9df3f Merge pull request #222 from eltociear/patch-1
docs: update README.md
2025-04-05 01:08:25 +09:00
Ikko Eltociear Ashimine 035f37d1d1 docs: update README.md
minor fix
2025-03-31 00:31:42 +09:00
Dr.Lt.Data 9d179f0193 Merge pull request #220 from ComfyNodePRs/update-publish-yaml
Update Github Action for Publishing to Comfy Registry
2025-03-29 00:32:18 +09:00
snomiao f64211c3f3 chore(publish): update GitHub Actions workflow for node publishing
- Add permissions for writing issues
- Update publish-node-action to use version v1
- Add condition to run job only for 'ltdrdata' repository owner
2025-01-21 08:42:07 +00:00
10 changed files with 99 additions and 25 deletions
+6 -2
View File
@@ -7,15 +7,19 @@ on:
paths:
- "pyproject.toml"
permissions:
issues: write
jobs:
publish-node:
name: Publish Custom Node to registry
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'ltdrdata' }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Publish Custom Node
uses: Comfy-Org/publish-node-action@main
uses: Comfy-Org/publish-node-action@v1
with:
## Add your own personal access token to your Github Repository secrets and reference it here.
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
+4 -2
View File
@@ -2,7 +2,8 @@
This repository offers various extension nodes for ComfyUI. Nodes here have different characteristics compared to those in the ComfyUI Impact Pack. The Impact Pack has become too large now...
## Notice:
* v1.9.1 To avoid confusion with the `NOISE` type in core, the type name has been changed to `NOISE_IMAGE`.
* V1.18: To use the 'OSS' Scheduler, please update to ComfyUI version 0.3.28 or later (April 13th or newer) and Impact Pack version V8.11 or higher.
* V1.9.1 To avoid confusion with the `NOISE` type in core, the type name has been changed to `NOISE_IMAGE`.
* V0.73 The Variation Seed feature is added to Regional Prompt nodes, and it is only compatible with versions Impact Pack V5.10 and above.
* V0.69 incompatible with the outdated **ComfyUI IPAdapter Plus**. (A version dated March 24th or later is required.)
* V0.64 add sigma_factor to RegionalPrompt... nodes required Impact Pack V4.76 or later.
@@ -172,7 +173,8 @@ This repository offers various extension nodes for ComfyUI. Nodes here have diff
* `Float Range (Inspire)`: Create a float list that increases the value by `step` from `start` to `stop`. A list as large as the maximum limit is created, and when `ensure_end` is enabled, the last value of the list becomes the stop value.
* `Worklist To Item List (Inspire)`: The list in ComfyUI allows for repeated execution of a sub-workflow. This groups these repetitions (a.k.a. list) into a single ITEM_LIST output. ITEM_LIST can then be used in ForeachList.
* `▶Foreach List (Inspire)`: A starting node for performing iterative tasks by retrieving items one by one from the ITEM_LIST.\nGenerate a new intermediate_output using item and intermediate_output as inputs, then connect it to ForeachListEnd.\nNOTE:If initial_input is omitted, the first item in item_list is used as the initial value, and the processing starts from the second item in item_list.
* `Foreach List◀ (Inspire)`: A end node for performing iterative tasks by retrieving items one by one from the ITEM_LIST.\nNOTE:Directly connect the outputs of ForeachListBegin to 'flow_control' and 'remained_list'.
* `Foreach List◀ (Inspire)`: An end node for performing iterative tasks by retrieving items one by one from the ITEM_LIST.\nNOTE:Directly connect the outputs of ForeachListBegin to 'flow_control' and 'remained_list'.
* `Drop List (Inspire)`: Removes all items from the ITEM_LIST. If the ITEM_LIST generated through this node is passed to ForeachListEnd, the process is immediately terminated.
### Util - Utilities
* `ToIPAdapterPipe (Inspire)`, `FromIPAdapterPipe (Inspire)`: These nodes assists in conveniently using the bundled ipadapter_model, clip_vision, and model required for applying IPAdapter.
+1 -11
View File
@@ -8,7 +8,7 @@
import importlib
import logging
version_code = [1, 16]
version_code = [1, 20]
version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
logging.info(f"### Loading: ComfyUI-Inspire-Pack ({version_str})")
@@ -39,13 +39,3 @@ for module_name in node_list:
WEB_DIRECTORY = "./js"
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]
try:
import cm_global
cm_global.register_extension('ComfyUI-Inspire-Pack',
{'version': version_code,
'name': 'Inspire Pack',
'nodes': set(NODE_CLASS_MAPPINGS.keys()),
'description': 'This extension provides various nodes to support Lora Block Weight and the Impact Pack. Provides many easily applicable regional features and applications for Variation Seed.', })
except:
pass
+1 -1
View File
@@ -189,7 +189,7 @@ class RetrieveBackendData:
if v is None:
logging.warning(f"[RetrieveBackendData] '{key}' is unregistered key.")
return (None,)
return ([None],)
is_list, data = v[1]
+48 -4
View File
@@ -15,6 +15,48 @@ from .libs.utils import ByPassTypeTuple, empty_pil_tensor, empty_latent
from PIL import Image
import numpy as np
import logging
import re
def extract_first_number(s):
match = re.search(r'\d+', s)
return int(match.group()) if match else float('inf')
sort_methods = [
"None",
"Alphabetical (ASC)",
"Alphabetical (DESC)",
"Numerical (ASC)",
"Numerical (DESC)",
"Datetime (ASC)",
"Datetime (DESC)"
]
def sort_by(items, base_path='.', method=None):
def fullpath(x): return os.path.join(base_path, x)
def get_timestamp(path):
try:
return os.path.getmtime(path)
except FileNotFoundError:
return float('-inf')
if method == "Alphabetical (ASC)":
return sorted(items)
elif method == "Alphabetical (DESC)":
return sorted(items, reverse=True)
elif method == "Numerical (ASC)":
return sorted(items, key=lambda x: extract_first_number(os.path.splitext(x)[0]))
elif method == "Numerical (DESC)":
return sorted(items, key=lambda x: extract_first_number(os.path.splitext(x)[0]), reverse=True)
elif method == "Datetime (ASC)":
return sorted(items, key=lambda x: get_timestamp(fullpath(x)))
elif method == "Datetime (DESC)":
return sorted(items, key=lambda x: get_timestamp(fullpath(x)), reverse=True)
else:
return items
class LoadImagesFromDirBatch:
@@ -28,6 +70,7 @@ class LoadImagesFromDirBatch:
"image_load_cap": ("INT", {"default": 0, "min": 0, "step": 1}),
"start_index": ("INT", {"default": 0, "min": -1, "max": 0xffffffffffffffff, "step": 1}),
"load_always": ("BOOLEAN", {"default": False, "label_on": "enabled", "label_off": "disabled"}),
"sort_method": (sort_methods,),
}
}
@@ -43,7 +86,7 @@ class LoadImagesFromDirBatch:
else:
return hash(frozenset(kwargs))
def load_images(self, directory: str, image_load_cap: int = 0, start_index: int = 0, load_always=False):
def load_images(self, directory: str, image_load_cap: int = 0, start_index: int = 0, load_always=False, sort_method=None):
if not os.path.isdir(directory):
raise FileNotFoundError(f"Directory '{directory} cannot be found.'")
dir_files = os.listdir(directory)
@@ -56,7 +99,7 @@ class LoadImagesFromDirBatch:
valid_extensions.extend('.jxl')
dir_files = [f for f in dir_files if any(f.lower().endswith(ext) for ext in valid_extensions)]
dir_files = sorted(dir_files)
dir_files = sort_by(dir_files, directory, sort_method)
dir_files = [os.path.join(directory, x) for x in dir_files]
# start at start_index
@@ -133,6 +176,7 @@ class LoadImagesFromDirList:
"image_load_cap": ("INT", {"default": 0, "min": 0, "step": 1}),
"start_index": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff, "step": 1}),
"load_always": ("BOOLEAN", {"default": False, "label_on": "enabled", "label_off": "disabled"}),
"sort_method": (sort_methods,),
}
}
@@ -151,7 +195,7 @@ class LoadImagesFromDirList:
else:
return hash(frozenset(kwargs))
def load_images(self, directory: str, image_load_cap: int = 0, start_index: int = 0, load_always=False):
def load_images(self, directory: str, image_load_cap: int = 0, start_index: int = 0, load_always=False, sort_method=None):
if not os.path.isdir(directory):
raise FileNotFoundError(f"Directory '{directory}' cannot be found.")
dir_files = os.listdir(directory)
@@ -164,7 +208,7 @@ class LoadImagesFromDirList:
valid_extensions.extend('.jxl')
dir_files = [f for f in dir_files if any(f.lower().endswith(ext) for ext in valid_extensions)]
dir_files = sorted(dir_files)
dir_files = sort_by(dir_files, directory, sort_method)
dir_files = [os.path.join(directory, x) for x in dir_files]
# start at start_index
+1 -1
View File
@@ -5,7 +5,7 @@ import logging
from server import PromptServer
SCHEDULERS = comfy.samplers.KSampler.SCHEDULERS + ['AYS SDXL', 'AYS SD1', 'AYS SVD', "GITS[coeff=1.2]"]
SCHEDULERS = comfy.samplers.KSampler.SCHEDULERS + ['AYS SDXL', 'AYS SD1', 'AYS SVD', "GITS[coeff=1.2]", 'OSS FLUX', 'OSS Wan']
def impact_sampling(*args, **kwargs):
+1
View File
@@ -30,6 +30,7 @@ model_preset = {
"SD1.5 FaceID Portrait v11": ("ip-adapter-faceid-portrait-v11_sd15", "CLIP-ViT-H-14-laion2B-s32B-b79K", None, True),
"SD1.5 FaceID Portrait": ("ip-adapter-faceid-portrait_sd15", "CLIP-ViT-H-14-laion2B-s32B-b79K", None, True),
"SDXL FaceID": ("ip-adapter-faceid_sdxl", "CLIP-ViT-H-14-laion2B-s32B-b79K", "ip-adapter-faceid_sdxl_lora", True),
"SDXL FaceID Plus v2": ("ip-adapter-faceid-plusv2_sdxl", "CLIP-ViT-H-14-laion2B-s32B-b79K", "ip-adapter-faceid-plusv2_sdxl_lora", True),
"SDXL FaceID Portrait": ("ip-adapter-faceid-portrait_sdxl", "CLIP-ViT-H-14-laion2B-s32B-b79K", None, True),
"SDXL FaceID Portrait unnorm": ("ip-adapter-faceid-portrait_sdxl_unnorm", "CLIP-ViT-H-14-laion2B-s32B-b79K", None, True),
"Kolors FaceID Plus": ("Kolors-IP-Adapter-FaceID-Plus", "clip-vit-large-patch14-336", None, True),
+35 -2
View File
@@ -130,7 +130,7 @@ class LoadPromptsFromDir:
for prompt in prompt_list:
pattern = r"^(?:(?:positive:(?P<positive>.*?)|negative:(?P<negative>.*?)|name:(?P<name>.*?))\n*)+$"
matches = re.search(pattern, prompt, re.DOTALL)
matches = re.search(pattern, prompt, re.DOTALL | re.IGNORECASE)
if matches:
positive_text = matches.group('positive').strip()
@@ -487,6 +487,37 @@ class GlobalSeed:
return {}
class SeedLogger:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff}),
"seeds": ("STRING", {"multiline": True, "dynamicPrompts": False, "control_after_generate": False}),
"limit": ("INT", {"default": 5, "min": 0, "max": 0xffffffffffffffff}),
},
"hidden": {"unique_id": "UNIQUE_ID"}
}
RETURN_TYPES = ()
FUNCTION = "doit"
CATEGORY = "InspirePack/Prompt"
OUTPUT_NODE = True
def doit(self, seed, seeds: str, limit, unique_id):
if limit > 0:
lines = seeds.split('\n')
res = str(seed) + '\n' + '\n'.join(lines[:limit-1])
else:
res = str(seed) + '\n' + seeds
PromptServer.instance.send_sync("inspire-node-feedback", {"node_id": unique_id, "widget_name": "seeds", "type": "text", "data": res})
return {}
class GlobalSampler:
@classmethod
def INPUT_TYPES(s):
@@ -993,6 +1024,7 @@ NODE_CLASS_MAPPINGS = {
"ZipPrompt //Inspire": ZipPrompt,
"PromptExtractor //Inspire": PromptExtractor,
"GlobalSeed //Inspire": GlobalSeed,
"SeedLogger //Inspire": SeedLogger,
"GlobalSampler //Inspire": GlobalSampler,
"BindImageListPromptList //Inspire": BindImageListPromptList,
"WildcardEncode //Inspire": WildcardEncodeInspire,
@@ -1004,7 +1036,7 @@ NODE_CLASS_MAPPINGS = {
"MakeBasicPipe //Inspire": MakeBasicPipe,
"RemoveControlNet //Inspire": RemoveControlNet,
"RemoveControlNetFromRegionalPrompts //Inspire": RemoveControlNetFromRegionalPrompts,
"CompositeNoise //Inspire": CompositeNoise
"CompositeNoise //Inspire": CompositeNoise,
}
NODE_DISPLAY_NAME_MAPPINGS = {
@@ -1015,6 +1047,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"ZipPrompt //Inspire": "Zip Prompt (Inspire)",
"PromptExtractor //Inspire": "Prompt Extractor (Inspire)",
"GlobalSeed //Inspire": "Global Seed (Inspire)",
"SeedLogger //Inspire": "Seed Logger (Inspire)",
"GlobalSampler //Inspire": "Global Sampler (Inspire)",
"BindImageListPromptList //Inspire": "Bind [ImageList, PromptList] (Inspire)",
"WildcardEncode //Inspire": "Wildcard Encode (Inspire)",
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui-inspire-pack"
description = "This extension provides various nodes to support Lora Block Weight, Regional Nodes, Backend Cache, Prompt Utils, List Utils, Noise(Seed) Utils, ... and the Impact Pack."
version = "1.16"
version = "1.20"
license = { file = "LICENSE" }
dependencies = ["matplotlib", "cachetools"]
+1 -1
View File
@@ -1,5 +1,5 @@
matplotlib
cachetools
numpy<2
numpy
webcolors
opencv-python