From a310f4593b3c68f472d8c01479fc6b8e98822e5b Mon Sep 17 00:00:00 2001 From: Jax <65150735+Kebolder@users.noreply.github.com> Date: Mon, 29 Dec 2025 12:35:06 -0600 Subject: [PATCH] Transmit request to resize the canvas with Krita Output node (#52) * Added Krita Resize node for plugin * Registered canvas resize node to the __init__.py * Removed resizenode and integrated it into the "Krita output" * Quick update to simplify the node to return the re-sized image to krita instead of a json --- krita.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/krita.py b/krita.py index da3bfc5..3c74186 100644 --- a/krita.py +++ b/krita.py @@ -80,13 +80,24 @@ class KritaOutput(io.ComfyNode): node_id="ETN_KritaOutput", display_name="Krita Output", category="krita", - inputs=[io.Image.Input("images")], + inputs=[ + io.Image.Input("images"), + io.Boolean.Input("resize_canvas", default=False), + ], is_output_node=True, ) @classmethod - def execute(cls, images: torch.Tensor): - return SendImageWebSocket.execute(images, "PNG") + def execute(cls, images: torch.Tensor, resize_canvas: bool = False): + result = SendImageWebSocket.execute(images, "PNG") + ui = getattr(result, "ui", {}) or {} + ui = dict(ui) + # Values in the UI dict must be lists so ComfyUI can concatenate them + # across batched executions. Store a single structured entry. + ui["resize_canvas"] = [{"enabled": bool(resize_canvas)}] + result.ui = ui + + return result class KritaSendText(io.ComfyNode):