From 4b672ff45bfac79c264d7f899c855f51bb4c2d30 Mon Sep 17 00:00:00 2001 From: cest-la-v <22951622+cest-la-v@users.noreply.github.com> Date: Sun, 29 Mar 2026 20:40:55 +0800 Subject: [PATCH] fix: guard against unregistered class_type in _is_intermediate_output Commit 3696c5ba introduced _is_intermediate_output which iterates over all node IDs in the prompt after execution, including orphan/disconnected nodes that are never validated or executed. If any such node's class_type is not in NODE_CLASS_MAPPINGS (e.g. a custom node pack that failed to load or was renamed), NODE_CLASS_MAPPINGS[class_type] raises KeyError. This exception short-circuits the while...else block, preventing: - execution_success from being sent to the frontend - self.history_result from being assigned Images are still saved to disk since SaveImage runs during the main execution loop, but the Gallery plugin never receives the success event and the /history API returns incomplete data. Fix: use .get() with a None guard so unregistered nodes are silently treated as non-intermediate-output nodes. --- execution.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/execution.py b/execution.py index e15eb4bda..e0a58562c 100644 --- a/execution.py +++ b/execution.py @@ -413,7 +413,9 @@ def format_value(x): def _is_intermediate_output(dynprompt, node_id): class_type = dynprompt.get_node(node_id)["class_type"] - class_def = nodes.NODE_CLASS_MAPPINGS[class_type] + class_def = nodes.NODE_CLASS_MAPPINGS.get(class_type) + if class_def is None: + return False return getattr(class_def, 'HAS_INTERMEDIATE_OUTPUT', False) def _send_cached_ui(server, node_id, display_node_id, cached, prompt_id, ui_outputs):