Compare commits

...
5 Commits
Author SHA1 Message Date
KarrixLee 0e1f1cd6ba tweak 2025-06-28 00:33:49 +08:00
KarrixLee 57dd0d9167 tweal 2025-06-28 00:32:34 +08:00
KarrixLee b2de923440 hi 2025-06-28 00:30:09 +08:00
KarrixLee 6d2b918ef1 tweak 2025-06-28 00:27:00 +08:00
KarrixLee d8b1e88c03 hi 2025-06-28 00:23:25 +08:00
2 changed files with 49 additions and 1 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ class ComfyDeployOutputText:
}
)
return {"ui": {"text_file": results}}
return {"ui": {"text_file": results, "text": [text]}}
NODE_CLASS_MAPPINGS = {"ComfyDeployOutputText": ComfyDeployOutputText}
+48
View File
@@ -497,6 +497,54 @@ const ext = {
},
async beforeRegisterNodeDef(nodeType, nodeData, app2) {
// Add text display functionality for ComfyDeployOutputText
if (nodeData.name === "ComfyDeployOutputText") {
const onNodeCreated = nodeType.prototype.onNodeCreated;
nodeType.prototype.onNodeCreated = function () {
onNodeCreated ? onNodeCreated.apply(this, []) : undefined;
// Wait a bit to ensure all other widgets are created first
setTimeout(() => {
// Import ComfyWidgets if not available globally
const ComfyWidgets = app2.widgets || window.ComfyWidgets;
// Create widget exactly like rgthree does
this.textDisplayWidget = ComfyWidgets["STRING"](
this,
"displayed_text",
["STRING", { multiline: true }],
app2
).widget;
// Make it read-only
this.textDisplayWidget.inputEl.readOnly = true;
// Style it
this.textDisplayWidget.inputEl.style.fontFamily = "monospace";
// Ensure it doesn't get serialized
this.textDisplayWidget.serializeValue = () => undefined;
this.textDisplayWidget.serialize = false;
// Remove it from widgets_values array if it exists
const widgetIndex = this.widgets.indexOf(this.textDisplayWidget);
if (widgetIndex > -1 && this.widgets_values) {
this.widgets_values.splice(widgetIndex, 1);
}
}, 100);
};
const onExecuted = nodeType.prototype.onExecuted;
nodeType.prototype.onExecuted = function (message) {
onExecuted?.apply(this, [message]);
// Display the text output on the node
if (message.text && message.text.length > 0 && this.textDisplayWidget) {
this.textDisplayWidget.value = message.text[0];
}
};
}
const origGetExtraMenuOptions = nodeType.prototype.getExtraMenuOptions;
nodeType.prototype.getExtraMenuOptions = function (_, options) {
const r = origGetExtraMenuOptions