diff --git a/more_math/StackUnBatcher.py b/more_math/StackUnBatcher.py index 1312ad1..86d12e0 100644 --- a/more_math/StackUnBatcher.py +++ b/more_math/StackUnBatcher.py @@ -1,13 +1,21 @@ -class StackUnBatcher: - @classmethod +from comfy_api.latest import io +from .Stack import MrmthStack + +class StackUnBatcher(io.ComfyNode): + @classmethod def define_schema(cls) -> io.Schema: return io.Schema( node_id="mrmth_StackUnBatcher", category="More math", display_name="Stack UnBatcher", + is_input_list=True, inputs=[ - io.Stack.Input(id="stack", tooltip="Input stack to unbatch"), + MrmthStack.Input(id="stack", tooltip="Input stack to unbatch"), ], outputs=[ - io.Stack.Output(id="unbatched", tooltip="Unbatched stack output"), - ],ยดรบ \ No newline at end of file + MrmthStack.Output(id="unbatched", tooltip="Unbatched stack output"), + ]) + + @classmethod + def execute(cls, stack): + return (stack[-1],) \ No newline at end of file diff --git a/more_math/nodes.py b/more_math/nodes.py index 6686912..90857b6 100644 --- a/more_math/nodes.py +++ b/more_math/nodes.py @@ -28,6 +28,7 @@ from .NoiseMathNode import NoiseMathNode from .AudioMathNode import AudioMathNode from .StringMathNode import StringMathNode from .SelectiveGuiderMathNode import SelectiveGuiderMathNode +from .StackUnBatcher import StackUnBatcher from .ScriptTextWindow import ScriptTextInput @@ -172,7 +173,8 @@ class MoreMathExtension(ComfyExtension): AudioMathNode, StringMathNode, ScriptTextInput, - SelectiveGuiderMathNode + SelectiveGuiderMathNode, + StackUnBatcher ]