standard feature

This commit is contained in:
pythongosssss
2023-04-16 11:34:17 +01:00
parent 2579b19aa6
commit fdc19de359
-39
View File
@@ -1,39 +0,0 @@
import { app } from "/scripts/app.js";
import { ComfyWidgets } from "/scripts/widgets.js";
// For adding notes
const id = "pysssss.StickyNote";
app.registerExtension({
name: id,
addCustomNodeDefs(defs) {
defs.StickyNote = {
name: "StickyNote",
display_name: "Note",
category: "utils",
input: {
required: {
note: ["STRING", { multiline: true }],
},
},
};
},
beforeRegisterNodeDef(nodeType) {
if (nodeType.comfyClass === "StickyNote") {
const onNodeCreated = nodeType.prototype.onNodeCreated;
nodeType.prototype.onNodeCreated = function () {
const r = onNodeCreated?.apply(this, arguments);
const w = this.widgets[0];
w.inputEl.style.fontFamily = "cursive";
w.inputEl.style.backgroundColor = "transparent";
w.inputEl.style.mixBlendMode = "difference";
w.inputEl.style.color = "white";
return r;
};
nodeType.color = "#ffff7c";
nodeType.bgcolor = "#ffff7c";
}
},
});