Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Fix KeyError when prompt entries lack class_type key (#12595)

Jedrzej Kosinski33f83d53ae38
diff --git a/app/node_replace_manager.py b/app/node_replace_manager.py
index 03b603c70..d9aab5b22 100644
--- a/app/node_replace_manager.py
+++ b/app/node_replace_manager.py
@@ -46,6 +46,8 @@ class NodeReplaceManager:
connections: dict[str, list[tuple[str, str, int]]] = {}
need_replacement: set[str] = set()
for node_number, node_struct in prompt.items():
+ if "class_type" not in node_struct or "inputs" not in node_struct:
+ continue
class_type = node_struct["class_type"]
# 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):