mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-02 13:22:32 +08:00
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.
This commit is contained in:
parent
443074eee9
commit
4b672ff45b
@ -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):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user