2023-04-15 23:50:05 +00:00
|
|
|
import {app} from "../../scripts/app.js";
|
|
|
|
import {ComfyWidgets} from "../../scripts/widgets.js";
|
|
|
|
// Node that add notes to your project
|
|
|
|
|
|
|
|
app.registerExtension({
|
|
|
|
name: "Comfy.NoteNode",
|
|
|
|
registerCustomNodes() {
|
|
|
|
class NoteNode {
|
|
|
|
color=LGraphCanvas.node_colors.yellow.color;
|
|
|
|
bgcolor=LGraphCanvas.node_colors.yellow.bgcolor;
|
|
|
|
groupcolor = LGraphCanvas.node_colors.yellow.groupcolor;
|
|
|
|
constructor() {
|
|
|
|
if (!this.properties) {
|
|
|
|
this.properties = {};
|
2023-04-15 23:58:46 +00:00
|
|
|
this.properties.text="";
|
2023-04-15 23:50:05 +00:00
|
|
|
}
|
|
|
|
|
2023-04-15 23:58:46 +00:00
|
|
|
ComfyWidgets.STRING(this, "", ["", {default:this.properties.text, multiline: true}], app)
|
2023-04-15 23:50:05 +00:00
|
|
|
// This node is purely frontend and does not impact the resulting prompt so should not be serialized
|
|
|
|
this.isVirtualNode = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Load default visibility
|
|
|
|
|
|
|
|
LiteGraph.registerNodeType(
|
|
|
|
"Note",
|
|
|
|
Object.assign(NoteNode, {
|
|
|
|
title_mode: LiteGraph.NORMAL_TITLE,
|
|
|
|
title: "Note",
|
|
|
|
collapsable: true,
|
|
|
|
})
|
|
|
|
);
|
|
|
|
|
|
|
|
NoteNode.category = "utils";
|
|
|
|
},
|
|
|
|
});
|