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
c982c937
Commit
c982c937
authored
Apr 08, 2023
by
comfyanonymous
Browse files
Merge branch 'catch-configure-errors' of
https://github.com/pythongosssss/ComfyUI
parents
b0edcfdc
b78ebfcf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
2 deletions
+46
-2
web/scripts/app.js
web/scripts/app.js
+46
-2
No files found.
web/scripts/app.js
View file @
c982c937
import
{
ComfyWidgets
}
from
"
./widgets.js
"
;
import
{
ComfyWidgets
}
from
"
./widgets.js
"
;
import
{
ComfyUI
}
from
"
./ui.js
"
;
import
{
ComfyUI
,
$el
}
from
"
./ui.js
"
;
import
{
api
}
from
"
./api.js
"
;
import
{
api
}
from
"
./api.js
"
;
import
{
defaultGraph
}
from
"
./defaultGraph.js
"
;
import
{
defaultGraph
}
from
"
./defaultGraph.js
"
;
import
{
getPngMetadata
,
importA1111
}
from
"
./pnginfo.js
"
;
import
{
getPngMetadata
,
importA1111
}
from
"
./pnginfo.js
"
;
...
@@ -875,7 +875,51 @@ class ComfyApp {
...
@@ -875,7 +875,51 @@ class ComfyApp {
}
}
}
}
this
.
graph
.
configure
(
graphData
);
try
{
this
.
graph
.
configure
(
graphData
);
}
catch
(
error
)
{
let
errorHint
=
[];
// Try extracting filename to see if it was caused by an extension script
const
filename
=
error
.
fileName
||
(
error
.
stack
||
""
).
match
(
/
(\/
extensions
\/
.*
\.
js
)
/
)?.[
1
];
const
pos
=
(
filename
||
""
).
indexOf
(
"
/extensions/
"
);
if
(
pos
>
-
1
)
{
errorHint
.
push
(
$el
(
"
span
"
,
{
textContent
:
"
This may be due to the following script:
"
}),
$el
(
"
br
"
),
$el
(
"
span
"
,
{
style
:
{
fontWeight
:
"
bold
"
,
},
textContent
:
filename
.
substring
(
pos
),
})
);
}
// Show dialog to let the user know something went wrong loading the data
this
.
ui
.
dialog
.
show
(
$el
(
"
div
"
,
[
$el
(
"
p
"
,
{
textContent
:
"
Loading aborted due to error reloading workflow data
"
}),
$el
(
"
pre
"
,
{
style
:
{
padding
:
"
5px
"
,
backgroundColor
:
"
rgba(255,0,0,0.2)
"
},
textContent
:
error
.
toString
(),
}),
$el
(
"
pre
"
,
{
style
:
{
padding
:
"
5px
"
,
color
:
"
#ccc
"
,
fontSize
:
"
10px
"
,
maxHeight
:
"
50vh
"
,
overflow
:
"
auto
"
,
backgroundColor
:
"
rgba(0,0,0,0.2)
"
,
},
textContent
:
error
.
stack
||
"
No stacktrace available
"
,
}),
...
errorHint
,
]).
outerHTML
);
return
;
}
for
(
const
node
of
this
.
graph
.
_nodes
)
{
for
(
const
node
of
this
.
graph
.
_nodes
)
{
const
size
=
node
.
computeSize
();
const
size
=
node
.
computeSize
();
...
...
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