From 3d23256dd19de58da707afe7ce18e8f197a3d6de Mon Sep 17 00:00:00 2001 From: Pauan Date: Wed, 25 Mar 2026 22:47:07 -0700 Subject: [PATCH 1/2] Adding in selection bounds to Krita Selection node --- krita.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/krita.py b/krita.py index 68c7beb..3fba10b 100644 --- a/krita.py +++ b/krita.py @@ -214,12 +214,16 @@ def define_schema(cls): io.Boolean.Output("active", "active"), io.Int.Output("x", "offset x"), io.Int.Output("y", "offset y"), + io.Int.Output("selection_x", "selection x"), + io.Int.Output("selection_y", "selection y"), + io.Int.Output("selection_width", "selection width"), + io.Int.Output("selection_height", "selection height"), ], ) @classmethod def execute(cls, **kwargs): - return io.NodeOutput(torch.ones(1, 512, 512), False, 0, 0) + return io.NodeOutput(torch.ones(1, 512, 512), False, 0, 0, 0, 0, 512, 512) class KritaImageLayer(io.ComfyNode): From a909248bbe1ee5a0a9ced15bd18f239203fa15fc Mon Sep 17 00:00:00 2001 From: Pauan Date: Thu, 2 Apr 2026 15:04:22 -0700 Subject: [PATCH 2/2] Splitting into separate Krita Selection Bounds node --- __init__.py | 1 + krita.py | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/__init__.py b/__init__.py index 08f2e47..5e22b41 100644 --- a/__init__.py +++ b/__init__.py @@ -28,6 +28,7 @@ async def get_node_list(self) -> list[type[io.ComfyNode]]: krita.KritaSendText, krita.KritaCanvas, krita.KritaSelection, + krita.KritaSelectionBounds, krita.KritaImageLayer, krita.KritaMaskLayer, krita.Parameter, diff --git a/krita.py b/krita.py index 3fba10b..b761843 100644 --- a/krita.py +++ b/krita.py @@ -214,16 +214,32 @@ def define_schema(cls): io.Boolean.Output("active", "active"), io.Int.Output("x", "offset x"), io.Int.Output("y", "offset y"), - io.Int.Output("selection_x", "selection x"), - io.Int.Output("selection_y", "selection y"), - io.Int.Output("selection_width", "selection width"), - io.Int.Output("selection_height", "selection height"), ], ) @classmethod def execute(cls, **kwargs): - return io.NodeOutput(torch.ones(1, 512, 512), False, 0, 0, 0, 0, 512, 512) + return io.NodeOutput(torch.ones(1, 512, 512), False, 0, 0) + + +class KritaSelectionBounds(io.ComfyNode): + @classmethod + def define_schema(cls): + return io.Schema( + node_id="ETN_KritaSelectionBounds", + display_name="Krita Selection Bounds", + category="krita", + outputs=[ + io.Int.Output("x", "x"), + io.Int.Output("y", "y"), + io.Int.Output("width", "width"), + io.Int.Output("height", "height"), + ], + ) + + @classmethod + def execute(cls, **kwargs): + return io.NodeOutput(0, 0, 512, 512) class KritaImageLayer(io.ComfyNode):