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
496de089
Commit
496de089
authored
Dec 03, 2023
by
pythongosssss
Browse files
Allow removing erroring embedded groups
Unregister group nodes on workflow change
parent
61a123a1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
4 deletions
+58
-4
web/extensions/core/groupNode.js
web/extensions/core/groupNode.js
+28
-1
web/scripts/app.js
web/scripts/app.js
+25
-3
web/style.css
web/style.css
+5
-0
No files found.
web/extensions/core/groupNode.js
View file @
496de089
...
...
@@ -475,6 +475,16 @@ export class GroupNodeConfig {
}
static async registerFromWorkflow(groupNodes, missingNodeTypes) {
const clean = app.clean;
app.clean = function () {
for (const g in groupNodes) {
try {
LiteGraph.unregisterNodeType("workflow/" + g);
} catch (error) {}
}
app.clean = clean;
};
for (const g in groupNodes) {
const groupData = groupNodes[g];
...
...
@@ -482,7 +492,24 @@ export class GroupNodeConfig {
for (const n of groupData.nodes) {
// Find missing node types
if (!(n.type in LiteGraph.registered_node_types)) {
missingNodeTypes.push(n.type);
missingNodeTypes.push({
type: n.type,
hint: `
(
In
group
node
'
workflow/${g}
'
)
`,
});
missingNodeTypes.push({
type: "workflow/" + g,
action: {
text: "Remove from workflow",
callback: (e) => {
delete groupNodes[g];
e.target.textContent = "Removed";
e.target.style.pointerEvents = "none";
e.target.style.opacity = 0.7;
},
},
});
hasMissing = true;
}
}
...
...
web/scripts/app.js
View file @
496de089
...
...
@@ -1519,14 +1519,36 @@ export class ComfyApp {
}
showMissingNodesError
(
missingNodeTypes
,
hasAddedNodes
=
true
)
{
let
seenTypes
=
new
Set
();
this
.
ui
.
dialog
.
show
(
$el
(
"
div
"
,
[
$el
(
"
div
.comfy-missing-nodes
"
,
[
$el
(
"
span
"
,
{
textContent
:
"
When loading the graph, the following node types were not found:
"
}),
$el
(
"
ul
"
,
Array
.
from
(
new
Set
(
missingNodeTypes
)).
map
((
t
)
=>
$el
(
"
li
"
,
{
textContent
:
t
}))
Array
.
from
(
new
Set
(
missingNodeTypes
)).
map
((
t
)
=>
{
let
children
=
[];
if
(
typeof
t
===
"
object
"
)
{
if
(
seenTypes
.
has
(
t
.
type
))
return
null
;
seenTypes
.
add
(
t
.
type
);
children
.
push
(
$el
(
"
span
"
,
{
textContent
:
t
.
type
}));
if
(
t
.
hint
)
{
children
.
push
(
$el
(
"
span
"
,
{
textContent
:
t
.
hint
}));
}
if
(
t
.
action
)
{
children
.
push
(
$el
(
"
button
"
,
{
onclick
:
t
.
action
.
callback
,
textContent
:
t
.
action
.
text
}));
}
}
else
{
if
(
seenTypes
.
has
(
t
))
return
null
;
seenTypes
.
add
(
t
);
children
.
push
(
$el
(
"
span
"
,
{
textContent
:
t
}));
}
return
$el
(
"
li
"
,
children
);
}).
filter
(
Boolean
)
),
...(
hasAddedNodes
?
[
$el
(
"
span
"
,
{
textContent
:
"
Nodes that have failed to load will show as red on the graph.
"
})]
:
[]),
...(
hasAddedNodes
?
[
$el
(
"
span
"
,
{
textContent
:
"
Nodes that have failed to load will show as red on the graph.
"
})]
:
[]),
])
);
this
.
logging
.
addEntry
(
"
Comfy.App
"
,
"
warn
"
,
{
...
...
web/style.css
View file @
496de089
...
...
@@ -424,6 +424,11 @@ dialog::backdrop {
height
:
var
(
--comfy-img-preview-height
);
}
.comfy-missing-nodes
li
button
{
font-size
:
12px
;
margin-left
:
5px
;
}
/* Search box */
.litegraph.litesearchbox
{
...
...
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