diff --git a/src/extensions/core/noteNode.ts b/src/extensions/core/noteNode.ts index 0e745e6be..d58124035 100644 --- a/src/extensions/core/noteNode.ts +++ b/src/extensions/core/noteNode.ts @@ -25,11 +25,11 @@ app.registerExtension({ if (!this.properties) { this.properties = { text: '' } } - ComfyWidgets.MARKDOWN( + ComfyWidgets.STRING( // Should we extends LGraphNode? Yesss this, '', - ['', { default: this.properties.text }], + ['', { default: this.properties.text, multiline: true }], app ) @@ -50,5 +50,33 @@ app.registerExtension({ ) NoteNode.category = 'utils' + + /** Markdown variant of NoteNode */ + class MarkdownNoteNode extends LGraphNode { + static title = 'Markdown Note' + + color = LGraphCanvas.node_colors.yellow.color + bgcolor = LGraphCanvas.node_colors.yellow.bgcolor + groupcolor = LGraphCanvas.node_colors.yellow.groupcolor + + constructor(title?: string) { + super(title) + if (!this.properties) { + this.properties = { text: '' } + } + ComfyWidgets.MARKDOWN( + this, + '', + ['', { default: this.properties.text }], + app + ) + + this.serialize_widgets = true + this.isVirtualNode = true + } + } + + LiteGraph.registerNodeType('MarkdownNote', MarkdownNoteNode) + MarkdownNoteNode.category = 'utils' } }) diff --git a/src/stores/nodeDefStore.ts b/src/stores/nodeDefStore.ts index 7091e916e..f6acc7322 100644 --- a/src/stores/nodeDefStore.ts +++ b/src/stores/nodeDefStore.ts @@ -289,6 +289,19 @@ export const SYSTEM_NODE_DEFS: Record = { output_node: false, python_module: 'nodes', description: 'Node that add notes to your project' + }, + MarkdownNote: { + name: 'MarkdownNote', + display_name: 'Markdown Note', + category: 'utils', + input: { required: {}, optional: {} }, + output: [], + output_name: [], + output_is_list: [], + output_node: false, + python_module: 'nodes', + description: + 'Node that add notes to your project. Reformats text as markdown.' } }