mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-05 17:27:42 +08:00
Fix KeyError when prompt entries lack class_type key
Skip entries in the prompt dict that don't contain a class_type key in apply_replacements(), preventing crashes on metadata or non-node entries. Fixes Comfy-Org/ComfyUI#12517 Amp-Thread-ID: https://ampcode.com/threads/T-019c8ae9-0bc0-77de-8bde-a4a7de38cff2 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
parent
caa43d2395
commit
13dc544db2
@ -46,6 +46,8 @@ class NodeReplaceManager:
|
|||||||
connections: dict[str, list[tuple[str, str, int]]] = {}
|
connections: dict[str, list[tuple[str, str, int]]] = {}
|
||||||
need_replacement: set[str] = set()
|
need_replacement: set[str] = set()
|
||||||
for node_number, node_struct in prompt.items():
|
for node_number, node_struct in prompt.items():
|
||||||
|
if "class_type" not in node_struct:
|
||||||
|
continue
|
||||||
class_type = node_struct["class_type"]
|
class_type = node_struct["class_type"]
|
||||||
# need replacement if not in NODE_CLASS_MAPPINGS and has replacement
|
# need replacement if not in NODE_CLASS_MAPPINGS and has replacement
|
||||||
if class_type not in nodes.NODE_CLASS_MAPPINGS.keys() and self.has_replacement(class_type):
|
if class_type not in nodes.NODE_CLASS_MAPPINGS.keys() and self.has_replacement(class_type):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user