Add InputZip, InputUnzip

This commit is contained in:
Dr.Lt.Data 2023-06-16 22:34:44 +09:00
parent 173bdd280b
commit dce406d851

View File

@ -53,7 +53,42 @@ class LoopCounterCondition:
return (CounterCondition(count), )
# To facilitate the use of multiple inputs as loopback inputs, InputZip and InputUnzip are provided.
class InputZip:
@classmethod
def INPUT_TYPES(s):
return {"required": {
"input1": ("*", ),
"input2": ("*", ),
},
}
RETURN_TYPES = ("*", )
FUNCTION = "doit"
def doit(s, input1, input2):
return ((input1, input2), )
class InputUnzip:
@classmethod
def INPUT_TYPES(s):
return {"required": {
"zipped_input": ("*", ),
},
}
RETURN_TYPES = ("*", "*", )
FUNCTION = "doit"
def doit(s, zipped_input):
input1, input2 = zipped_input
return (input1, input2, )
NODE_CLASS_MAPPINGS = {
"LoopControl": LoopControl,
"LoopCounterCondition": LoopCounterCondition,
"InputZip": InputZip,
"InputUnzip": InputUnzip,
}