Multiple changes

This commit is contained in:
Lukas Julian Lambertz
2025-06-21 14:00:44 +02:00
parent 3046949004
commit e30d922e2b
4 changed files with 55 additions and 59 deletions
+4
View File
@@ -7,15 +7,19 @@ from .nodes.text_processing import NODE_CLASS_MAPPINGS as TEXT_NODES
from .nodes.text_processing import NODE_DISPLAY_NAME_MAPPINGS as TEXT_DISPLAY_NAMES
from .nodes.utilities import UTILITY_NODE_CLASS_MAPPINGS as UTILITY_NODES
from .nodes.utilities import UTILITY_NODE_DISPLAY_NAME_MAPPINGS as UTILITY_DISPLAY_NAMES
from .nodes.timing import TIMING_NODE_CLASS_MAPPINGS as TIMING_NODES
from .nodes.timing import TIMING_NODE_DISPLAY_NAME_MAPPINGS as TIMING_DISPLAY_NAMES
# Combine all node mappings
NODE_CLASS_MAPPINGS = {}
NODE_CLASS_MAPPINGS.update(TEXT_NODES)
NODE_CLASS_MAPPINGS.update(UTILITY_NODES)
NODE_CLASS_MAPPINGS.update(TIMING_NODES)
NODE_DISPLAY_NAME_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS.update(TEXT_DISPLAY_NAMES)
NODE_DISPLAY_NAME_MAPPINGS.update(UTILITY_DISPLAY_NAMES)
NODE_DISPLAY_NAME_MAPPINGS.update(TIMING_DISPLAY_NAMES)
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']
-6
View File
@@ -1,8 +1,3 @@
"""
Text Processing Nodes for ComfyUI
Provides various text manipulation utilities
"""
class TextSplitter:
"""
Node for splitting text strings by a delimiter
@@ -158,7 +153,6 @@ class ListInfo:
return (count, first_item, last_item)
# Node mappings for ComfyUI
NODE_CLASS_MAPPINGS = {
"DebugPadawan_TextSplitter": TextSplitter,
"DebugPadawan_TextJoiner": TextJoiner,
+51
View File
@@ -0,0 +1,51 @@
import time
# from https://github.com/pythongosssss/ComfyUI-Custom-Scripts
class AnyType(str):
def __ne__(self, __value: object) -> bool:
return False
any = AnyType("*")
class WaitNode:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"value": (any, {"forceInput": True}),
"wait_time_ms": ("INT", {
"default": 1000,
"min": 0,
}),
}
}
RETURN_TYPES = ("*",)
RETURN_NAMES = ("passthrough",)
FUNCTION = "wait_and_pass"
CATEGORY = "DebugPadawan/Timing"
def wait_and_pass(self, value, wait_time_ms):
"""
Wait for the specified time and pass the input through
Args:
value: Any value to pass through
wait_time_ms (int): Time to wait in milliseconds
Returns:
The same value (passthrough)
"""
time.sleep(wait_time_ms / 1000.0)
return (value,)
TIMING_NODE_CLASS_MAPPINGS = {
"DebugPadawan_WaitNode": WaitNode,
}
TIMING_NODE_DISPLAY_NAME_MAPPINGS = {
"DebugPadawan_WaitNode": "Wait Node",
}
-53
View File
@@ -1,10 +1,3 @@
"""
Utility Nodes for ComfyUI
Provides various helper utilities
"""
import time
# from https://github.com/pythongosssss/ComfyUI-Custom-Scripts
class AnyType(str):
def __ne__(self, __value: object) -> bool:
@@ -98,58 +91,12 @@ class ConditionalString:
"""
return (true_string if condition else false_string,)
class WaitNode:
"""
Node that waits for a specified number of milliseconds before passing the input through
"""
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"value": (any, {"forceInput": True}),
"wait_time_ms": ("INT", {
"default": 1000, # Default wait time is 1000 ms (1 second)
"min": 0, # Minimum wait time is 0 ms
}),
}
}
# Use wildcard for output type to pass through any type
RETURN_TYPES = ("*",)
RETURN_NAMES = ("passthrough",)
FUNCTION = "wait_and_pass"
CATEGORY = "DebugPadawan/Utilities"
def wait_and_pass(self, value, wait_time_ms):
"""
Wait for the specified time and pass the input through
Args:
value: Any value to pass through
wait_time_ms (int): Time to wait in milliseconds
Returns:
The same value (passthrough)
"""
# Convert milliseconds to seconds and wait
time.sleep(wait_time_ms / 1000.0)
# Return the original value unchanged
return (value,)
# Add these to the main mappings if needed
UTILITY_NODE_CLASS_MAPPINGS = {
"DebugPadawan_DebugPrint": DebugPrint,
"DebugPadawan_ConditionalString": ConditionalString,
"DebugPadawan_WaitNode": WaitNode,
}
UTILITY_NODE_DISPLAY_NAME_MAPPINGS = {
"DebugPadawan_DebugPrint": "Debug Print",
"DebugPadawan_ConditionalString": "Conditional String",
"DebugPadawan_WaitNode": "Wait Node",
}