-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnodes.py
70 lines (59 loc) · 1.66 KB
/
nodes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import time
class CooldownStringNode:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"STRING" : ("STRING", {"forceInput": True}),
"sleep" : ("INT", {"default": 1, "min": 0, "max": 300})
},
}
OUTPUT_NODE = True
RETURN_TYPES = ("STRING",)
CATEGORY = "Cooldown"
FUNCTION = "main"
def main(self, STRING, sleep):
time.sleep(sleep)
return (STRING,)
class CooldownIntNode:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"INT" : ("INT", {"forceInput": True}),
"sleep" : ("INT", {"default": 1, "min": 0, "max": 300})
},
}
OUTPUT_NODE = True
RETURN_TYPES = ("INT",)
CATEGORY = "Cooldown"
FUNCTION = "main"
def main(self, INT, sleep):
time.sleep(sleep)
return (INT,)
class CooldownImageNode:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"IMAGE" : ("IMAGE", {"forceInput": True}),
"sleep" : ("INT", {"default": 1, "min": 0, "max": 300})
},
}
OUTPUT_NODE = True
RETURN_TYPES = ("IMAGE",)
CATEGORY = "Cooldown"
FUNCTION = "main"
def main(self, IMAGE, sleep):
time.sleep(sleep)
return (IMAGE,)
NODE_CLASS_MAPPINGS = {
"CooldownStringNode": CooldownStringNode,
"CooldownIntNode": CooldownIntNode,
"CooldownImageNode": CooldownImageNode,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"CooldownStringNode": "Cooldown -STRING-",
"CooldownIntNode": "Cooldown -INT-",
"CooldownImageNode": "Cooldown -IMAGE-",
}