Skip to content

Commit

Permalink
Fix support for generic input types.
Browse files Browse the repository at this point in the history
- Introduced AnyType class to allow flexible input handling.
- Updated INPUT_TYPES to accept any_type for input parameter.
- Modified RETURN_TYPES to use any_type and changed RETURN_NAMES to "output" for clarity.
  • Loading branch information
a-und-b committed Jan 10, 2025
1 parent 3c74be4 commit 1b2af93
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions add_delay_node.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import time

class AnyType(str):
def __ne__(self, __value: object) -> bool:
return False

any_type = AnyType("*")

class add_delay_node:
"""Node that adds a configurable delay between operations"""

@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"input": ("*",),
"input": (any_type, {"defaultInput": True}),
"delay_seconds": ("FLOAT", {
"default": 1.0,
"min": 0.0,
Expand All @@ -16,8 +22,8 @@ def INPUT_TYPES(cls):
},
}

RETURN_TYPES = ("*",)
RETURN_NAMES = ("input",)
RETURN_TYPES = (any_type,)
RETURN_NAMES = ("output",)
FUNCTION = "add_delay"
CATEGORY = "utils"

Expand Down

0 comments on commit 1b2af93

Please sign in to comment.