From 5ac1aed2a8ea176bb42462cf019f1cf62b18fe94 Mon Sep 17 00:00:00 2001 From: BISAM20 Date: Fri, 26 Jun 2026 11:25:12 +0200 Subject: [PATCH] Remove status widget and refresh input from the node Drop the "status" text widget (editor JS) and the "refresh" int input (Python node) to declutter the node. generate_masks gains **kwargs to absorb stray values from older saved workflows. Co-Authored-By: Claude Opus 4.8 --- animated_mask_node.py | 10 ++-------- web/animated_mask_drawer.js | 33 --------------------------------- 2 files changed, 2 insertions(+), 41 deletions(-) diff --git a/animated_mask_node.py b/animated_mask_node.py index 8c1c2c5..4b564ed 100644 --- a/animated_mask_node.py +++ b/animated_mask_node.py @@ -126,12 +126,6 @@ class AnimatedMaskDrawer: "default": False, "tooltip": "Invert mask (swap masked/unmasked areas)" }), - "refresh": ("INT", { - "default": 0, - "min": 0, - "max": 999999, - "tooltip": "Increment this value to force regeneration of masks" - }), # NOTE: keep new widgets LAST. ComfyUI serializes widget values # positionally, so inserting one mid-list shifts every saved # value in existing workflows and breaks them. @@ -156,8 +150,8 @@ class AnimatedMaskDrawer: CATEGORY = "mask/animation" OUTPUT_NODE = False - def generate_masks(self, video, width=0, height=0, feather=0, invert=False, refresh=0, - auto_resolution=True, mask_data="", unique_id=None): + def generate_masks(self, video, width=0, height=0, feather=0, invert=False, + auto_resolution=True, mask_data="", unique_id=None, **kwargs): """ Generate animated masks based on keyframe data """ diff --git a/web/animated_mask_drawer.js b/web/animated_mask_drawer.js index 08bd804..49d54c7 100644 --- a/web/animated_mask_drawer.js +++ b/web/animated_mask_drawer.js @@ -33,35 +33,8 @@ app.registerExtension({ openMaskEditor(this); }); - // Add status text - const statusWidget = this.addWidget("text", "status", "Ready", () => {}, { - multiline: false - }); - statusWidget.disabled = true; - - // Store reference for updates - this.maskEditorStatus = statusWidget; - return r; } - - // Override execution to show status - const onExecuted = nodeType.prototype.onExecuted; - nodeType.prototype.onExecuted = function(message) { - if (onExecuted) { - onExecuted.apply(this, arguments); - } - - if (this.maskEditorStatus) { - try { - const maskData = message.mask_data_json ? JSON.parse(message.mask_data_json) : null; - const shapeCount = maskData?.shapes?.length || 0; - this.maskEditorStatus.value = `✔ Generated (${shapeCount} shapes)`; - } catch (e) { - this.maskEditorStatus.value = "✔ Masks generated"; - } - } - } } } }); @@ -77,12 +50,6 @@ maskEditorChannel.onmessage = (e) => { const graphNode = app.graph?.getNodeById?.(node); if (graphNode && graphNode.maskDataWidget) { graphNode.maskDataWidget.value = data; - if (graphNode.maskEditorStatus) { - try { - const shapeCount = JSON.parse(data)?.shapes?.length || 0; - graphNode.maskEditorStatus.value = `✔ ${shapeCount} shapes saved`; - } catch (_) { /* ignore */ } - } app.graph.setDirtyCanvas(true, true); } };