Skip to content

Commit 4bc1884

Browse files
authored
Provide a better error message when attempting to execute the workflow with a missing node. (comfyanonymous#3517)
1 parent 09e069a commit 4bc1884

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

execution.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,17 @@ def full_type_name(klass):
622622
def validate_prompt(prompt):
623623
outputs = set()
624624
for x in prompt:
625+
if 'class_type' not in prompt[x]:
626+
error = {
627+
"type": "invalid_prompt",
628+
"message": f"Cannot execute due to a missing node",
629+
"details": f"Node ID '#{x}'",
630+
"extra_info": {}
631+
}
632+
return (False, error, [], [])
633+
625634
class_ = nodes.NODE_CLASS_MAPPINGS[prompt[x]['class_type']]
626-
if hasattr(class_, 'OUTPUT_NODE') and class_.OUTPUT_NODE == True:
635+
if hasattr(class_, 'OUTPUT_NODE') and class_.OUTPUT_NODE is True:
627636
outputs.add(x)
628637

629638
if len(outputs) == 0:

0 commit comments

Comments
 (0)