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
bc475f86
Commit
bc475f86
authored
Jan 26, 2023
by
comfyanonymous
Browse files
Slightly better errors.
parent
7996420f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
main.py
main.py
+5
-2
No files found.
main.py
View file @
bc475f86
...
...
@@ -220,7 +220,7 @@ def validate_inputs(prompt, item):
if
isinstance
(
type_input
,
list
):
if
val
not
in
type_input
:
return
(
False
,
"Value not in list. {}, {}"
.
format
(
class_type
,
x
))
return
(
False
,
"Value not in list. {},
{}: {} not in
{}"
.
format
(
class_type
,
x
,
val
,
type_input
))
return
(
True
,
""
)
def
validate_prompt
(
prompt
):
...
...
@@ -234,6 +234,7 @@ def validate_prompt(prompt):
return
(
False
,
"Prompt has no outputs"
)
good_outputs
=
set
()
errors
=
[]
for
o
in
outputs
:
valid
=
False
reason
=
""
...
...
@@ -250,9 +251,11 @@ def validate_prompt(prompt):
else
:
print
(
"Failed to validate prompt for output {} {}"
.
format
(
o
,
reason
))
print
(
"output will be ignored"
)
errors
+=
[(
o
,
reason
)]
if
len
(
good_outputs
)
==
0
:
return
(
False
,
"Prompt has no properly connected outputs"
)
errors_list
=
"
\n
"
.
join
(
map
(
lambda
a
:
"{}"
.
format
(
a
[
1
]),
errors
))
return
(
False
,
"Prompt has no properly connected outputs
\n
{}"
.
format
(
errors_list
))
return
(
True
,
""
)
...
...
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