From 4bc1884478a14dea2d64a34f9beb1c52a2d16b09 Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" <128333288+ltdrdata@users.noreply.github.com> Date: Mon, 20 May 2024 19:58:46 +0900 Subject: [PATCH] Provide a better error message when attempting to execute the workflow with a missing node. (#3517) --- execution.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/execution.py b/execution.py index 47d58b9d..86bde1c4 100644 --- a/execution.py +++ b/execution.py @@ -622,8 +622,17 @@ def full_type_name(klass): def validate_prompt(prompt): outputs = set() for x in prompt: + if 'class_type' not in prompt[x]: + error = { + "type": "invalid_prompt", + "message": f"Cannot execute due to a missing node", + "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 == True: + if hasattr(class_, 'OUTPUT_NODE') and class_.OUTPUT_NODE is True: outputs.add(x) if len(outputs) == 0: