From 4c569a01306b2548470b083a68d23393bd8fb68f Mon Sep 17 00:00:00 2001 From: Dariusz L Date: Sat, 28 Jun 2025 02:49:07 +0200 Subject: [PATCH] Remove optional input_image and input_mask parameters Eliminates the 'optional' input_image and input_mask parameters from the CanvasNode class and its process_canvas_image method. Fallback logic for these parameters is also removed, simplifying the code and relying solely on WebSocket cache for image and mask data. --- canvas_node.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/canvas_node.py b/canvas_node.py index cb48954..85a77af 100644 --- a/canvas_node.py +++ b/canvas_node.py @@ -170,10 +170,6 @@ class CanvasNode: "trigger": ("INT", {"default": 0, "min": 0, "max": 99999999, "step": 1, "hidden": True}), "node_id": ("STRING", {"default": "0", "hidden": True}), }, - "optional": { - "input_image": ("IMAGE",), - "input_mask": ("MASK",) - }, "hidden": { "prompt": ("PROMPT",), "unique_id": ("UNIQUE_ID",), @@ -234,8 +230,7 @@ class CanvasNode: _processing_lock = threading.Lock() - def process_canvas_image(self, trigger, node_id, prompt=None, unique_id=None, input_image=None, - input_mask=None): + def process_canvas_image(self, trigger, node_id, prompt=None, unique_id=None): try: @@ -272,13 +267,7 @@ class CanvasNode: processed_mask = torch.from_numpy(mask_array)[None,] log_debug(f"Mask loaded from WebSocket, shape: {processed_mask.shape}") else: - log_warn(f"No canvas data found for node {storage_key} in WebSocket cache, using fallbacks.") - if input_image is not None: - log_info("Using provided input_image as fallback") - processed_image = input_image - if input_mask is not None: - log_info("Using provided input_mask as fallback") - processed_mask = input_mask + log_warn(f"No canvas data found for node {storage_key} in WebSocket cache.") if processed_image is None: log_warn(f"Processed image is still None, creating default blank image.")