diff --git a/__init__.py b/__init__.py index 5b98434..d2ab731 100644 --- a/__init__.py +++ b/__init__.py @@ -2,7 +2,7 @@ @author: Crystian @title: Crystools @nickname: Crystools -@version: 1.24.0 +@version: 1.25.0 @project: "https://github.com/crystian/ComfyUI-Crystools", @description: Plugins for multiples uses, mainly for debugging, you need them! IG: https://www.instagram.com/crystian.ia """ @@ -13,7 +13,7 @@ logger.info(f'Crystools version: {version}') from .nodes._names import CLASSES from .nodes.primitive import CBoolean, CText, CTextML, CInteger, CFloat from .nodes.switch import CSwitchBooleanAny, CSwitchBooleanLatent, CSwitchBooleanConditioning, CSwitchBooleanImage, \ - CSwitchBooleanString, CSwitchBooleanMask + CSwitchBooleanString, CSwitchBooleanMask, CSwitchFromAny from .nodes.debugger import CConsoleAny, CConsoleAnyToJson from .nodes.image import CImagePreviewFromImage, CImageLoadWithMetadata, CImageGetResolution, CImagePreviewFromMetadata, \ CImageSaveWithExtraMetadata @@ -38,6 +38,7 @@ NODE_CLASS_MAPPINGS = { CLASSES.CLIST_ANY_NAME.value: CListAny, CLASSES.CLIST_STRING_NAME.value: CListString, + CLASSES.CSWITCH_FROM_ANY_NAME.value: CSwitchFromAny, CLASSES.CSWITCH_ANY_NAME.value: CSwitchBooleanAny, CLASSES.CSWITCH_LATENT_NAME.value: CSwitchBooleanLatent, CLASSES.CSWITCH_CONDITIONING_NAME.value: CSwitchBooleanConditioning, @@ -75,6 +76,7 @@ NODE_DISPLAY_NAME_MAPPINGS = { CLASSES.CLIST_ANY_NAME.value: CLASSES.CLIST_ANY_DESC.value, CLASSES.CLIST_STRING_NAME.value: CLASSES.CLIST_STRING_DESC.value, + CLASSES.CSWITCH_FROM_ANY_NAME.value: CLASSES.CSWITCH_FROM_ANY_DESC.value, CLASSES.CSWITCH_ANY_NAME.value: CLASSES.CSWITCH_ANY_DESC.value, CLASSES.CSWITCH_LATENT_NAME.value: CLASSES.CSWITCH_LATENT_DESC.value, CLASSES.CSWITCH_CONDITIONING_NAME.value: CLASSES.CSWITCH_CONDITIONING_DESC.value, diff --git a/core/version.py b/core/version.py index 953f835..ccc8689 100644 --- a/core/version.py +++ b/core/version.py @@ -1 +1 @@ -version = "1.24.0" +version = "1.25.0" diff --git a/nodes/_names.py b/nodes/_names.py index eef1b4c..55f5714 100644 --- a/nodes/_names.py +++ b/nodes/_names.py @@ -28,6 +28,8 @@ class CLASSES(Enum): CLIST_STRING_NAME = 'List of strings [Crystools]' CLIST_STRING_DESC = prefix + 'List of strings' + CSWITCH_FROM_ANY_NAME = 'Switch from any [Crystools]' + CSWITCH_FROM_ANY_DESC = prefix + 'Switch from any' CSWITCH_ANY_NAME = 'Switch any [Crystools]' CSWITCH_ANY_DESC = prefix + 'Switch any' CSWITCH_STRING_NAME = 'Switch string [Crystools]' diff --git a/nodes/image.py b/nodes/image.py index f61a611..4a540de 100644 --- a/nodes/image.py +++ b/nodes/image.py @@ -1,3 +1,4 @@ +import fnmatch import os import random import sys @@ -234,12 +235,17 @@ class CImageLoadWithMetadata: @classmethod def INPUT_TYPES(cls): input_dir = folder_paths.get_input_directory() - exclude_folders = ["clipspace"] + + exclude_files = {"Thumbs.db", "*.DS_Store", "desktop.ini", "*.lock" } + exclude_folders = {"clipspace", ".*"} + file_list = [] for root, dirs, files in os.walk(input_dir): # Exclude specific folders - dirs[:] = [d for d in dirs if d not in exclude_folders] + dirs[:] = [d for d in dirs if not any(fnmatch.fnmatch(d, exclude) for exclude in exclude_folders)] + files = [f for f in files if not any(fnmatch.fnmatch(f, exclude) for exclude in exclude_files)] + for file in files: relpath = os.path.relpath(os.path.join(root, file), start=input_dir) diff --git a/nodes/switch.py b/nodes/switch.py index 33fe90e..6b07faf 100644 --- a/nodes/switch.py +++ b/nodes/switch.py @@ -1,6 +1,33 @@ from ..core import BOOLEAN, STRING, CATEGORY, any, logger +class CSwitchFromAny: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "any": (any, ), + "boolean": BOOLEAN, + } + } + + CATEGORY = CATEGORY.MAIN.value + CATEGORY.SWITCH.value + RETURN_TYPES = (any, any,) + RETURN_NAMES = ("on_true", "on_false",) + + FUNCTION = "execute" + + def execute(self, any,boolean=True): + logger.debug("Any switch: " + str(boolean)) + + if boolean: + return any, None + else: + return None, any + class CSwitchBooleanAny: def __init__(self): pass diff --git a/pyproject.toml b/pyproject.toml index 72c9a43..65ca8d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "ComfyUI-Crystools" description = "With this suit, you can see the resources monitor, progress bar & time elapsed, metadata and compare between two images, compare between two JSONs, show any value to console/display, pipes, and more!\nThis provides better nodes to load/save images, previews, etc, and see \"hidden\" data without loading a new workflow." -version = "1.24.0" +version = "1.25.0" license = { file = "LICENSE" } dependencies = ["deepdiff", "torch", "numpy", "Pillow", "pynvml", "py-cpuinfo"] diff --git a/version b/version index 53cc1a6..ad21919 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.24.0 +1.25.0 diff --git a/web/styles.js b/web/styles.js index 843268d..d6d073a 100644 --- a/web/styles.js +++ b/web/styles.js @@ -1,5 +1,5 @@ import { utils } from './comfy/index.js'; -utils.addStylesheet('extensions/ComfyUI-Crystools/monitor.css'); +utils.addStylesheet('extensions/comfyui-crystools/monitor.css'); export var Styles; (function (Styles) { Styles["BARS"] = "BARS"; diff --git a/web/styles.ts b/web/styles.ts index 3426fb9..4fef644 100644 --- a/web/styles.ts +++ b/web/styles.ts @@ -1,6 +1,6 @@ import { utils } from './comfy/index.js'; -utils.addStylesheet('extensions/ComfyUI-Crystools/monitor.css'); +utils.addStylesheet('extensions/comfyui-crystools/monitor.css'); export enum Styles { 'BARS' = 'BARS'