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.
This commit is contained in:
Dariusz L
2025-06-28 02:49:07 +02:00
parent 092748ef85
commit 4c569a0130

View File

@@ -170,10 +170,6 @@ class CanvasNode:
"trigger": ("INT", {"default": 0, "min": 0, "max": 99999999, "step": 1, "hidden": True}), "trigger": ("INT", {"default": 0, "min": 0, "max": 99999999, "step": 1, "hidden": True}),
"node_id": ("STRING", {"default": "0", "hidden": True}), "node_id": ("STRING", {"default": "0", "hidden": True}),
}, },
"optional": {
"input_image": ("IMAGE",),
"input_mask": ("MASK",)
},
"hidden": { "hidden": {
"prompt": ("PROMPT",), "prompt": ("PROMPT",),
"unique_id": ("UNIQUE_ID",), "unique_id": ("UNIQUE_ID",),
@@ -234,8 +230,7 @@ class CanvasNode:
_processing_lock = threading.Lock() _processing_lock = threading.Lock()
def process_canvas_image(self, trigger, node_id, prompt=None, unique_id=None, input_image=None, def process_canvas_image(self, trigger, node_id, prompt=None, unique_id=None):
input_mask=None):
try: try:
@@ -272,13 +267,7 @@ class CanvasNode:
processed_mask = torch.from_numpy(mask_array)[None,] processed_mask = torch.from_numpy(mask_array)[None,]
log_debug(f"Mask loaded from WebSocket, shape: {processed_mask.shape}") log_debug(f"Mask loaded from WebSocket, shape: {processed_mask.shape}")
else: else:
log_warn(f"No canvas data found for node {storage_key} in WebSocket cache, using fallbacks.") log_warn(f"No canvas data found for node {storage_key} in WebSocket cache.")
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
if processed_image is None: if processed_image is None:
log_warn(f"Processed image is still None, creating default blank image.") log_warn(f"Processed image is still None, creating default blank image.")