Skip to content

Commit

Permalink
Print error when node is missing.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed May 20, 2024
1 parent 4bc1884 commit 276f8fc
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,13 +625,23 @@ def validate_prompt(prompt):
if 'class_type' not in prompt[x]:
error = {
"type": "invalid_prompt",
"message": f"Cannot execute due to a missing node",
"message": f"Cannot execute because a node is missing the class_type property.",
"details": f"Node ID '#{x}'",
"extra_info": {}
}
return (False, error, [], [])

class_type = prompt[x]['class_type']
class_ = nodes.NODE_CLASS_MAPPINGS.get(class_type, None)
if class_ is None:
error = {
"type": "invalid_prompt",
"message": f"Cannot execute because node {class_type} does not exist.",
"details": f"Node ID '#{x}'",
"extra_info": {}
}
return (False, error, [], [])

class_ = nodes.NODE_CLASS_MAPPINGS[prompt[x]['class_type']]
if hasattr(class_, 'OUTPUT_NODE') and class_.OUTPUT_NODE is True:
outputs.add(x)

Expand Down

0 comments on commit 276f8fc

Please sign in to comment.