Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
1f34bf08
Commit
1f34bf08
authored
May 31, 2023
by
ltdrdata
Browse files
To support dynamic custom loading, separate the node registration
process based on the defs in the registerNodes function.
parent
606446d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
web/scripts/app.js
web/scripts/app.js
+5
-2
No files found.
web/scripts/app.js
View file @
1f34bf08
...
@@ -1010,6 +1010,11 @@ export class ComfyApp {
...
@@ -1010,6 +1010,11 @@ export class ComfyApp {
const
app
=
this
;
const
app
=
this
;
// Load node definitions from the backend
// Load node definitions from the backend
const
defs
=
await
api
.
getNodeDefs
();
const
defs
=
await
api
.
getNodeDefs
();
this
.
registerNodesFromDefs
(
defs
);
await
this
.
#
invokeExtensionsAsync
(
"
registerCustomNodes
"
);
}
async
registerNodesFromDefs
(
defs
)
{
await
this
.
#
invokeExtensionsAsync
(
"
addCustomNodeDefs
"
,
defs
);
await
this
.
#
invokeExtensionsAsync
(
"
addCustomNodeDefs
"
,
defs
);
// Generate list of known widgets
// Generate list of known widgets
...
@@ -1082,8 +1087,6 @@ export class ComfyApp {
...
@@ -1082,8 +1087,6 @@ export class ComfyApp {
LiteGraph
.
registerNodeType
(
nodeId
,
node
);
LiteGraph
.
registerNodeType
(
nodeId
,
node
);
node
.
category
=
nodeData
.
category
;
node
.
category
=
nodeData
.
category
;
}
}
await
this
.
#
invokeExtensionsAsync
(
"
registerCustomNodes
"
);
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment