Skip to content
This repository was archived by the owner on Jan 9, 2024. It is now read-only.

Commit eae090a

Browse files
Merge pull request #189 from philhk/optional-cnet_stack
Optional ControlNet Stack
2 parents 333f984 + 7eef738 commit eae090a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

efficiency_nodes.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,16 +369,19 @@ class TSC_Apply_ControlNet_Stack:
369369
@classmethod
370370
def INPUT_TYPES(cls):
371371
return {"required": {"positive": ("CONDITIONING",),
372-
"negative": ("CONDITIONING",),
373-
"cnet_stack": ("CONTROL_NET_STACK",)},
372+
"negative": ("CONDITIONING",)},
373+
"optional": {"cnet_stack": ("CONTROL_NET_STACK",)}
374374
}
375375

376376
RETURN_TYPES = ("CONDITIONING","CONDITIONING",)
377377
RETURN_NAMES = ("CONDITIONING+","CONDITIONING-",)
378378
FUNCTION = "apply_cnet_stack"
379379
CATEGORY = "Efficiency Nodes/Stackers"
380380

381-
def apply_cnet_stack(self, positive, negative, cnet_stack):
381+
def apply_cnet_stack(self, positive, negative, cnet_stack=None):
382+
if cnet_stack is None:
383+
return (positive, negative)
384+
382385
for control_net_tuple in cnet_stack:
383386
control_net, image, strength, start_percent, end_percent = control_net_tuple
384387
controlnet_conditioning = ControlNetApplyAdvanced().apply_controlnet(positive, negative, control_net, image,

0 commit comments

Comments
 (0)