From 21c9d7b289b6cc66a2b7aa60afbcbd3471694440 Mon Sep 17 00:00:00 2001 From: bigcat88 Date: Fri, 11 Jul 2025 22:34:22 +0300 Subject: [PATCH 1/4] V3 controlnet nodes: ControlNetApply, SetUnionControlNetType, ControlNetInpaintingAliMamaApply --- comfy_extras/v3/nodes_controlnet.py | 222 ++++++++++++++++++++++++++++ nodes.py | 1 + 2 files changed, 223 insertions(+) create mode 100644 comfy_extras/v3/nodes_controlnet.py diff --git a/comfy_extras/v3/nodes_controlnet.py b/comfy_extras/v3/nodes_controlnet.py new file mode 100644 index 000000000..3dad4add6 --- /dev/null +++ b/comfy_extras/v3/nodes_controlnet.py @@ -0,0 +1,222 @@ +from comfy.cldm.control_types import UNION_CONTROLNET_TYPES +import comfy.utils +from comfy_api.v3 import io + + +class ControlNetApplyAdvanced_V3(io.ComfyNodeV3): + @classmethod + def DEFINE_SCHEMA(cls): + return io.SchemaV3( + node_id="ControlNetApplyAdvanced_V3", + display_name="Apply ControlNet _V3", + category="conditioning/controlnet", + inputs=[ + io.Conditioning.Input( + "positive", + display_name="positive", + ), + io.Conditioning.Input( + "negative", + display_name="negative", + ), + io.ControlNet.Input( + "control_net", + display_name="control_net", + ), + io.Image.Input( + "image", + display_name="image", + ), + io.Float.Input( + "strength", + display_name="strength", + default=1.0, + min=0.0, + max=10.0, + step=0.01, + ), + io.Float.Input( + "start_percent", + display_name="start percent", + default=0.0, + min=0.0, + max=1.0, + step=0.001, + ), + io.Float.Input( + "end_percent", + display_name="end percent", + default=1.0, + min=0.0, + max=1.0, + step=0.001, + ), + io.Vae.Input( + "vae", + optional=True, + ), + ], + outputs=[ + io.Conditioning.Output( + "positive_out", + display_name="positive", + ), + io.Conditioning.Output( + "negative_out", + display_name="negative", + ), + ], + ) + + @classmethod + def execute(cls, positive, negative, control_net, image, strength, start_percent, end_percent, vae=None, extra_concat=[]): + if strength == 0: + return (positive, negative) + + control_hint = image.movedim(-1,1) + cnets = {} + + out = [] + for conditioning in [positive, negative]: + c = [] + for t in conditioning: + d = t[1].copy() + + prev_cnet = d.get('control', None) + if prev_cnet in cnets: + c_net = cnets[prev_cnet] + else: + c_net = control_net.copy().set_cond_hint(control_hint, strength, (start_percent, end_percent), vae=vae, extra_concat=extra_concat) + c_net.set_previous_controlnet(prev_cnet) + cnets[prev_cnet] = c_net + + d['control'] = c_net + d['control_apply_to_uncond'] = False + n = [t[0], d] + c.append(n) + out.append(c) + return (out[0], out[1]) + + +class SetUnionControlNetType_V3(io.ComfyNodeV3): + @classmethod + def DEFINE_SCHEMA(cls): + return io.SchemaV3( + node_id="SetUnionControlNetType_V3", + category="conditioning/controlnet", + inputs=[ + io.ControlNet.Input( + "control_net", + display_name="control_net", + ), + io.Combo.Input( + "type", + options=["auto"] + list(UNION_CONTROLNET_TYPES.keys()), + ), + ], + outputs=[ + io.ControlNet.Output( + "control_net_out", + display_name="control_net", + ), + ], + ) + + @classmethod + def execute(cls, control_net, type): + control_net = control_net.copy() + type_number = UNION_CONTROLNET_TYPES.get(type, -1) + if type_number >= 0: + control_net.set_extra_arg("control_type", [type_number]) + else: + control_net.set_extra_arg("control_type", []) + + return (control_net,) + + +class ControlNetInpaintingAliMamaApply_V3(ControlNetApplyAdvanced_V3): + @classmethod + def DEFINE_SCHEMA(cls): + return io.SchemaV3( + node_id="ControlNetInpaintingAliMamaApply_V3", + category="conditioning/controlnet", + inputs=[ + io.Conditioning.Input( + "positive", + display_name="positive", + ), + io.Conditioning.Input( + "negative", + display_name="negative", + ), + io.ControlNet.Input( + "control_net", + display_name="control_net", + ), + io.Vae.Input( + "vae", + display_name="vae", + ), + io.Image.Input( + "image", + display_name="image", + ), + io.Mask.Input( + "mask", + display_name="mask", + ), + io.Float.Input( + "strength", + display_name="strength", + default=1.0, + min=0.0, + max=10.0, + step=0.01, + ), + io.Float.Input( + "start_percent", + display_name="start percent", + default=0.0, + min=0.0, + max=1.0, + step=0.001, + ), + io.Float.Input( + "end_percent", + display_name="end percent", + default=1.0, + min=0.0, + max=1.0, + step=0.001, + ), + + ], + outputs=[ + io.Conditioning.Output( + "positive_out", + display_name="positive", + ), + io.Conditioning.Output( + "negative_out", + display_name="negative", + ), + ], + ) + + @classmethod + def execute(cls, positive, negative, control_net, vae, image, mask, strength, start_percent, end_percent): + extra_concat = [] + if control_net.concat_mask: + mask = 1.0 - mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])) + mask_apply = comfy.utils.common_upscale(mask, image.shape[2], image.shape[1], "bilinear", "center").round() + image = image * mask_apply.movedim(1, -1).repeat(1, 1, 1, image.shape[3]) + extra_concat = [mask] + + return super().execute(positive, negative, control_net, image, strength, start_percent, end_percent, vae=vae, extra_concat=extra_concat) + + +NODES_LIST: list[type[io.ComfyNodeV3]] = [ + ControlNetApplyAdvanced_V3, + SetUnionControlNetType_V3, + ControlNetInpaintingAliMamaApply_V3, +] diff --git a/nodes.py b/nodes.py index 4e4dae917..428b32bea 100644 --- a/nodes.py +++ b/nodes.py @@ -2299,6 +2299,7 @@ def init_builtin_extra_nodes(): "nodes_tcfg.py", "nodes_v3_test.py", "nodes_v1_test.py", + "v3/nodes_controlnet.py", "v3/nodes_images.py", "v3/nodes_mask.py", "v3/nodes_webcam.py", From af781cb96ca0fa6130bae85143b1b8e172d0dd1e Mon Sep 17 00:00:00 2001 From: bigcat88 Date: Fri, 11 Jul 2025 22:42:20 +0300 Subject: [PATCH 2/4] Reapply "V3 nodes: stable cascade" (#8873) This reverts commit eabd053227e5cdad2615461fb24a499bf204b69f. --- comfy_extras/v3/nodes_stable_cascade.py | 218 ++++++++++++++++++++++++ nodes.py | 1 + 2 files changed, 219 insertions(+) create mode 100644 comfy_extras/v3/nodes_stable_cascade.py diff --git a/comfy_extras/v3/nodes_stable_cascade.py b/comfy_extras/v3/nodes_stable_cascade.py new file mode 100644 index 000000000..af2893641 --- /dev/null +++ b/comfy_extras/v3/nodes_stable_cascade.py @@ -0,0 +1,218 @@ +""" + This file is part of ComfyUI. + Copyright (C) 2024 Stability AI + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +""" + +import torch +import nodes +import comfy.utils + +from comfy_api.v3 import io + + +class StableCascade_EmptyLatentImage_V3(io.ComfyNodeV3): + @classmethod + def DEFINE_SCHEMA(cls): + return io.SchemaV3( + node_id="StableCascade_EmptyLatentImage_V3", + category="latent/stable_cascade", + inputs=[ + io.Int.Input( + "width", + default=1024, + min=256, + max=nodes.MAX_RESOLUTION, step=8, + ), + io.Int.Input( + "height", + default=1024, + min=256, + max=nodes.MAX_RESOLUTION, + step=8, + ), + io.Int.Input( + "compression", + default=42, + min=4, + max=128, + step=1, + ), + io.Int.Input( + "batch_size", + default=1, + min=1, + max=4096, + ), + ], + outputs=[ + io.Latent.Output( + "stage_c", + display_name="stage_c", + ), + io.Latent.Output( + "stage_b", + display_name="stage_b", + ), + ], + ) + + @classmethod + def execute(cls, width, height, compression, batch_size=1): + c_latent = torch.zeros([batch_size, 16, height // compression, width // compression]) + b_latent = torch.zeros([batch_size, 4, height // 4, width // 4]) + return ({ + "samples": c_latent, + }, { + "samples": b_latent, + }) + + +class StableCascade_StageC_VAEEncode_V3(io.ComfyNodeV3): + @classmethod + def DEFINE_SCHEMA(cls): + return io.SchemaV3( + node_id="StableCascade_StageC_VAEEncode_V3", + category="latent/stable_cascade", + inputs=[ + io.Image.Input( + "image", + ), + io.Vae.Input( + "vae", + ), + io.Int.Input( + "compression", + default=42, + min=4, + max=128, + step=1, + ), + ], + outputs=[ + io.Latent.Output( + "stage_c", + display_name="stage_c", + ), + io.Latent.Output( + "stage_b", + display_name="stage_b", + ), + ], + ) + + @classmethod + def execute(cls, image, vae, compression): + width = image.shape[-2] + height = image.shape[-3] + out_width = (width // compression) * vae.downscale_ratio + out_height = (height // compression) * vae.downscale_ratio + + s = comfy.utils.common_upscale(image.movedim(-1,1), out_width, out_height, "bicubic", "center").movedim(1,-1) + + c_latent = vae.encode(s[:,:,:,:3]) + b_latent = torch.zeros([c_latent.shape[0], 4, (height // 8) * 2, (width // 8) * 2]) + return ({ + "samples": c_latent, + }, { + "samples": b_latent, + }) + + +class StableCascade_StageB_Conditioning_V3(io.ComfyNodeV3): + @classmethod + def DEFINE_SCHEMA(cls): + return io.SchemaV3( + node_id="StableCascade_StageB_Conditioning_V3", + category="conditioning/stable_cascade", + inputs=[ + io.Conditioning.Input( + "conditioning", + ), + io.Latent.Input( + "stage_c", + ), + ], + outputs=[ + io.Conditioning.Output( + "CONDITIONING", + ), + ], + ) + + @classmethod + def execute(cls, conditioning, stage_c): + c = [] + for t in conditioning: + d = t[1].copy() + d['stable_cascade_prior'] = stage_c['samples'] + n = [t[0], d] + c.append(n) + return (c, ) + + +class StableCascade_SuperResolutionControlnet_V3(io.ComfyNodeV3): + @classmethod + def DEFINE_SCHEMA(cls): + return io.SchemaV3( + node_id="StableCascade_SuperResolutionControlnet_V3", + category="_for_testing/stable_cascade", + is_experimental=True, + inputs=[ + io.Image.Input( + "image", + ), + io.Vae.Input( + "vae", + ), + ], + outputs=[ + io.Image.Output( + "controlnet_input", + display_name="controlnet_input", + ), + io.Latent.Output( + "stage_c", + display_name="stage_c", + ), + io.Latent.Output( + "stage_b", + display_name="stage_b", + ), + ], + ) + + @classmethod + def execute(cls, image, vae): + width = image.shape[-2] + height = image.shape[-3] + batch_size = image.shape[0] + controlnet_input = vae.encode(image[:,:,:,:3]).movedim(1, -1) + + c_latent = torch.zeros([batch_size, 16, height // 16, width // 16]) + b_latent = torch.zeros([batch_size, 4, height // 2, width // 2]) + return (controlnet_input, { + "samples": c_latent, + }, { + "samples": b_latent, + }) + + +NODES_LIST: list[type[io.ComfyNodeV3]] = [ + StableCascade_EmptyLatentImage_V3, + StableCascade_StageB_Conditioning_V3, + StableCascade_StageC_VAEEncode_V3, + StableCascade_SuperResolutionControlnet_V3, +] diff --git a/nodes.py b/nodes.py index 4e4dae917..c1806c646 100644 --- a/nodes.py +++ b/nodes.py @@ -2302,6 +2302,7 @@ def init_builtin_extra_nodes(): "v3/nodes_images.py", "v3/nodes_mask.py", "v3/nodes_webcam.py", + "v3/nodes_stable_cascade.py", ] import_failed = [] From c09213ebc11d7950e264860cb3823948fb7513f3 Mon Sep 17 00:00:00 2001 From: bigcat88 Date: Sat, 12 Jul 2025 10:33:02 +0300 Subject: [PATCH 3/4] V3 StableCascade nodes: use io.NodeOutput; adjust code style --- comfy_extras/v3/nodes_stable_cascade.py | 121 +++++------------------- 1 file changed, 23 insertions(+), 98 deletions(-) diff --git a/comfy_extras/v3/nodes_stable_cascade.py b/comfy_extras/v3/nodes_stable_cascade.py index af2893641..36d7e3321 100644 --- a/comfy_extras/v3/nodes_stable_cascade.py +++ b/comfy_extras/v3/nodes_stable_cascade.py @@ -30,42 +30,14 @@ class StableCascade_EmptyLatentImage_V3(io.ComfyNodeV3): node_id="StableCascade_EmptyLatentImage_V3", category="latent/stable_cascade", inputs=[ - io.Int.Input( - "width", - default=1024, - min=256, - max=nodes.MAX_RESOLUTION, step=8, - ), - io.Int.Input( - "height", - default=1024, - min=256, - max=nodes.MAX_RESOLUTION, - step=8, - ), - io.Int.Input( - "compression", - default=42, - min=4, - max=128, - step=1, - ), - io.Int.Input( - "batch_size", - default=1, - min=1, - max=4096, - ), + io.Int.Input("width", default=1024,min=256,max=nodes.MAX_RESOLUTION, step=8), + io.Int.Input("height", default=1024, min=256, max=nodes.MAX_RESOLUTION, step=8), + io.Int.Input("compression", default=42, min=4, max=128, step=1), + io.Int.Input("batch_size", default=1, min=1, max=4096), ], outputs=[ - io.Latent.Output( - "stage_c", - display_name="stage_c", - ), - io.Latent.Output( - "stage_b", - display_name="stage_b", - ), + io.Latent.Output("stage_c", display_name="stage_c"), + io.Latent.Output("stage_b", display_name="stage_b"), ], ) @@ -73,11 +45,7 @@ class StableCascade_EmptyLatentImage_V3(io.ComfyNodeV3): def execute(cls, width, height, compression, batch_size=1): c_latent = torch.zeros([batch_size, 16, height // compression, width // compression]) b_latent = torch.zeros([batch_size, 4, height // 4, width // 4]) - return ({ - "samples": c_latent, - }, { - "samples": b_latent, - }) + return io.NodeOutput({"samples": c_latent}, {"samples": b_latent}) class StableCascade_StageC_VAEEncode_V3(io.ComfyNodeV3): @@ -87,29 +55,13 @@ class StableCascade_StageC_VAEEncode_V3(io.ComfyNodeV3): node_id="StableCascade_StageC_VAEEncode_V3", category="latent/stable_cascade", inputs=[ - io.Image.Input( - "image", - ), - io.Vae.Input( - "vae", - ), - io.Int.Input( - "compression", - default=42, - min=4, - max=128, - step=1, - ), + io.Image.Input("image"), + io.Vae.Input("vae"), + io.Int.Input("compression", default=42, min=4, max=128, step=1), ], outputs=[ - io.Latent.Output( - "stage_c", - display_name="stage_c", - ), - io.Latent.Output( - "stage_b", - display_name="stage_b", - ), + io.Latent.Output("stage_c", display_name="stage_c"), + io.Latent.Output("stage_b", display_name="stage_b"), ], ) @@ -124,11 +76,7 @@ class StableCascade_StageC_VAEEncode_V3(io.ComfyNodeV3): c_latent = vae.encode(s[:,:,:,:3]) b_latent = torch.zeros([c_latent.shape[0], 4, (height // 8) * 2, (width // 8) * 2]) - return ({ - "samples": c_latent, - }, { - "samples": b_latent, - }) + return io.NodeOutput({"samples": c_latent}, {"samples": b_latent}) class StableCascade_StageB_Conditioning_V3(io.ComfyNodeV3): @@ -138,17 +86,11 @@ class StableCascade_StageB_Conditioning_V3(io.ComfyNodeV3): node_id="StableCascade_StageB_Conditioning_V3", category="conditioning/stable_cascade", inputs=[ - io.Conditioning.Input( - "conditioning", - ), - io.Latent.Input( - "stage_c", - ), + io.Conditioning.Input("conditioning"), + io.Latent.Input("stage_c"), ], outputs=[ - io.Conditioning.Output( - "CONDITIONING", - ), + io.Conditioning.Output(), ], ) @@ -160,7 +102,7 @@ class StableCascade_StageB_Conditioning_V3(io.ComfyNodeV3): d['stable_cascade_prior'] = stage_c['samples'] n = [t[0], d] c.append(n) - return (c, ) + return io.NodeOutput(c) class StableCascade_SuperResolutionControlnet_V3(io.ComfyNodeV3): @@ -171,26 +113,13 @@ class StableCascade_SuperResolutionControlnet_V3(io.ComfyNodeV3): category="_for_testing/stable_cascade", is_experimental=True, inputs=[ - io.Image.Input( - "image", - ), - io.Vae.Input( - "vae", - ), + io.Image.Input("image"), + io.Vae.Input("vae"), ], outputs=[ - io.Image.Output( - "controlnet_input", - display_name="controlnet_input", - ), - io.Latent.Output( - "stage_c", - display_name="stage_c", - ), - io.Latent.Output( - "stage_b", - display_name="stage_b", - ), + io.Image.Output("controlnet_input", display_name="controlnet_input"), + io.Latent.Output("stage_c", display_name="stage_c"), + io.Latent.Output("stage_b", display_name="stage_b"), ], ) @@ -203,11 +132,7 @@ class StableCascade_SuperResolutionControlnet_V3(io.ComfyNodeV3): c_latent = torch.zeros([batch_size, 16, height // 16, width // 16]) b_latent = torch.zeros([batch_size, 4, height // 2, width // 2]) - return (controlnet_input, { - "samples": c_latent, - }, { - "samples": b_latent, - }) + return io.NodeOutput(controlnet_input, {"samples": c_latent}, {"samples": b_latent}) NODES_LIST: list[type[io.ComfyNodeV3]] = [ From 535faa84f6425698f4cd7683210df7139ef2b29f Mon Sep 17 00:00:00 2001 From: bigcat88 Date: Sat, 12 Jul 2025 11:19:52 +0300 Subject: [PATCH 4/4] V3 ControlNet nodes: use io.NodeOutput; adjust code style --- comfy_extras/v3/nodes_controlnet.py | 157 ++++++---------------------- 1 file changed, 30 insertions(+), 127 deletions(-) diff --git a/comfy_extras/v3/nodes_controlnet.py b/comfy_extras/v3/nodes_controlnet.py index 3dad4add6..12d91a1ce 100644 --- a/comfy_extras/v3/nodes_controlnet.py +++ b/comfy_extras/v3/nodes_controlnet.py @@ -11,67 +11,25 @@ class ControlNetApplyAdvanced_V3(io.ComfyNodeV3): display_name="Apply ControlNet _V3", category="conditioning/controlnet", inputs=[ - io.Conditioning.Input( - "positive", - display_name="positive", - ), - io.Conditioning.Input( - "negative", - display_name="negative", - ), - io.ControlNet.Input( - "control_net", - display_name="control_net", - ), - io.Image.Input( - "image", - display_name="image", - ), - io.Float.Input( - "strength", - display_name="strength", - default=1.0, - min=0.0, - max=10.0, - step=0.01, - ), - io.Float.Input( - "start_percent", - display_name="start percent", - default=0.0, - min=0.0, - max=1.0, - step=0.001, - ), - io.Float.Input( - "end_percent", - display_name="end percent", - default=1.0, - min=0.0, - max=1.0, - step=0.001, - ), - io.Vae.Input( - "vae", - optional=True, - ), + io.Conditioning.Input("positive"), + io.Conditioning.Input("negative"), + io.ControlNet.Input("control_net"), + io.Image.Input("image"), + io.Float.Input("strength", default=1.0, min=0.0, max=10.0, step=0.01), + io.Float.Input("start_percent", default=0.0, min=0.0, max=1.0, step=0.001), + io.Float.Input("end_percent", default=1.0, min=0.0, max=1.0, step=0.001), + io.Vae.Input("vae", optional=True), ], outputs=[ - io.Conditioning.Output( - "positive_out", - display_name="positive", - ), - io.Conditioning.Output( - "negative_out", - display_name="negative", - ), + io.Conditioning.Output("positive_out", display_name="positive"), + io.Conditioning.Output("negative_out", display_name="negative"), ], ) @classmethod - def execute(cls, positive, negative, control_net, image, strength, start_percent, end_percent, vae=None, extra_concat=[]): + def execute(cls, positive, negative, control_net, image, strength, start_percent, end_percent, vae=None, extra_concat=[]) -> io.NodeOutput: if strength == 0: - return (positive, negative) + return io.NodeOutput(positive, negative) control_hint = image.movedim(-1,1) cnets = {} @@ -95,7 +53,7 @@ class ControlNetApplyAdvanced_V3(io.ComfyNodeV3): n = [t[0], d] c.append(n) out.append(c) - return (out[0], out[1]) + return io.NodeOutput(out[0], out[1]) class SetUnionControlNetType_V3(io.ComfyNodeV3): @@ -105,25 +63,16 @@ class SetUnionControlNetType_V3(io.ComfyNodeV3): node_id="SetUnionControlNetType_V3", category="conditioning/controlnet", inputs=[ - io.ControlNet.Input( - "control_net", - display_name="control_net", - ), - io.Combo.Input( - "type", - options=["auto"] + list(UNION_CONTROLNET_TYPES.keys()), - ), + io.ControlNet.Input("control_net"), + io.Combo.Input("type", options=["auto"] + list(UNION_CONTROLNET_TYPES.keys())), ], outputs=[ - io.ControlNet.Output( - "control_net_out", - display_name="control_net", - ), + io.ControlNet.Output("control_net_out"), ], ) @classmethod - def execute(cls, control_net, type): + def execute(cls, control_net, type) -> io.NodeOutput: control_net = control_net.copy() type_number = UNION_CONTROLNET_TYPES.get(type, -1) if type_number >= 0: @@ -131,7 +80,7 @@ class SetUnionControlNetType_V3(io.ComfyNodeV3): else: control_net.set_extra_arg("control_type", []) - return (control_net,) + return io.NodeOutput(control_net) class ControlNetInpaintingAliMamaApply_V3(ControlNetApplyAdvanced_V3): @@ -141,70 +90,24 @@ class ControlNetInpaintingAliMamaApply_V3(ControlNetApplyAdvanced_V3): node_id="ControlNetInpaintingAliMamaApply_V3", category="conditioning/controlnet", inputs=[ - io.Conditioning.Input( - "positive", - display_name="positive", - ), - io.Conditioning.Input( - "negative", - display_name="negative", - ), - io.ControlNet.Input( - "control_net", - display_name="control_net", - ), - io.Vae.Input( - "vae", - display_name="vae", - ), - io.Image.Input( - "image", - display_name="image", - ), - io.Mask.Input( - "mask", - display_name="mask", - ), - io.Float.Input( - "strength", - display_name="strength", - default=1.0, - min=0.0, - max=10.0, - step=0.01, - ), - io.Float.Input( - "start_percent", - display_name="start percent", - default=0.0, - min=0.0, - max=1.0, - step=0.001, - ), - io.Float.Input( - "end_percent", - display_name="end percent", - default=1.0, - min=0.0, - max=1.0, - step=0.001, - ), - + io.Conditioning.Input("positive"), + io.Conditioning.Input("negative"), + io.ControlNet.Input("control_net"), + io.Vae.Input("vae"), + io.Image.Input("image"), + io.Mask.Input("mask"), + io.Float.Input("strength", default=1.0, min=0.0, max=10.0, step=0.01), + io.Float.Input("start_percent", default=0.0, min=0.0, max=1.0, step=0.001), + io.Float.Input("end_percent", default=1.0, min=0.0, max=1.0, step=0.001), ], outputs=[ - io.Conditioning.Output( - "positive_out", - display_name="positive", - ), - io.Conditioning.Output( - "negative_out", - display_name="negative", - ), + io.Conditioning.Output("positive_out", display_name="positive"), + io.Conditioning.Output("negative_out", display_name="negative"), ], ) @classmethod - def execute(cls, positive, negative, control_net, vae, image, mask, strength, start_percent, end_percent): + def execute(cls, positive, negative, control_net, vae, image, mask, strength, start_percent, end_percent) -> io.NodeOutput: extra_concat = [] if control_net.concat_mask: mask = 1.0 - mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1]))