From 9a49da2c191c07632c766c9210d12ec6bf7fd4d7 Mon Sep 17 00:00:00 2001 From: philhk Date: Mon, 25 Sep 2023 23:27:30 +0200 Subject: [PATCH] feat: make cnet_stack optional --- efficiency_nodes.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/efficiency_nodes.py b/efficiency_nodes.py index 5635025..df8b23e 100644 --- a/efficiency_nodes.py +++ b/efficiency_nodes.py @@ -358,8 +358,8 @@ class TSC_Apply_ControlNet_Stack: @classmethod def INPUT_TYPES(cls): return {"required": {"positive": ("CONDITIONING",), - "negative": ("CONDITIONING",), - "cnet_stack": ("CONTROL_NET_STACK",)}, + "negative": ("CONDITIONING",)}, + "optional": {"cnet_stack": ("CONTROL_NET_STACK",)} } RETURN_TYPES = ("CONDITIONING","CONDITIONING",) @@ -367,7 +367,10 @@ class TSC_Apply_ControlNet_Stack: FUNCTION = "apply_cnet_stack" CATEGORY = "Efficiency Nodes/Stackers" - def apply_cnet_stack(self, positive, negative, cnet_stack): + def apply_cnet_stack(self, positive, negative, cnet_stack=None): + if cnet_stack is None: + return (positive, negative) + for control_net_tuple in cnet_stack: control_net, image, strength, start_percent, end_percent = control_net_tuple controlnet_conditioning = ControlNetApplyAdvanced().apply_controlnet(positive, negative,