Skip to content

Commit

Permalink
Fix node def registeration (#803)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Sep 12, 2024
1 parent 637f5b5 commit 8889c4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/scripts/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2013,7 +2013,7 @@ export class ComfyApp {
// TODO: change to "title?" once litegraph.d.ts has been updated
static title = nodeData.display_name || nodeData.name
static nodeData? = nodeData
static category: string = nodeData.category
static category?: string

constructor(title?: string) {
super(title)
Expand Down Expand Up @@ -2092,6 +2092,9 @@ export class ComfyApp {

await this.#invokeExtensionsAsync('beforeRegisterNodeDef', node, nodeData)
LiteGraph.registerNodeType(nodeId, node)
// Note: Do not move this to the class definition, it will be overwritten
// @ts-expect-error
node.category = nodeData.category
}

async registerNodesFromDefs(defs: Record<string, ComfyNodeDef>) {
Expand Down
2 changes: 1 addition & 1 deletion src/types/comfyLGraphNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export declare class ComfyLGraphNode extends LGraphNode {
static comfyClass: string
static title: string
static nodeData?: ComfyNodeDef
static category: string
static category?: string

constructor(title?: string)
}

0 comments on commit 8889c4d

Please sign in to comment.