"git@developer.sourcefind.cn:chenpangpang/ComfyUI.git" did not exist on "824e4935f53fdbda8f4608f511b4c2e8daf79dfa"
Commit bc475f86 authored by comfyanonymous's avatar comfyanonymous
Browse files

Slightly better errors.

parent 7996420f
...@@ -220,7 +220,7 @@ def validate_inputs(prompt, item): ...@@ -220,7 +220,7 @@ def validate_inputs(prompt, item):
if isinstance(type_input, list): if isinstance(type_input, list):
if val not in type_input: 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, "") return (True, "")
def validate_prompt(prompt): def validate_prompt(prompt):
...@@ -234,6 +234,7 @@ def validate_prompt(prompt): ...@@ -234,6 +234,7 @@ def validate_prompt(prompt):
return (False, "Prompt has no outputs") return (False, "Prompt has no outputs")
good_outputs = set() good_outputs = set()
errors = []
for o in outputs: for o in outputs:
valid = False valid = False
reason = "" reason = ""
...@@ -250,9 +251,11 @@ def validate_prompt(prompt): ...@@ -250,9 +251,11 @@ def validate_prompt(prompt):
else: else:
print("Failed to validate prompt for output {} {}".format(o, reason)) print("Failed to validate prompt for output {} {}".format(o, reason))
print("output will be ignored") print("output will be ignored")
errors += [(o, reason)]
if len(good_outputs) == 0: 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, "") return (True, "")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment