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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
bda55be363
commit
5ac1aed2a8
@@ -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
|
||||
"""
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user