diff --git a/web/extensions/core/rerouteNode.js b/web/extensions/core/rerouteNode.js index 83aea6361..0b65a51e8 100644 --- a/web/extensions/core/rerouteNode.js +++ b/web/extensions/core/rerouteNode.js @@ -55,6 +55,7 @@ app.registerExtension({ let updateNodes = []; let inputType = null; let inputNode = null; + let rootNode = null; while (currentNode) { updateNodes.unshift(currentNode); const linkId = currentNode.inputs[0].link; @@ -76,6 +77,7 @@ app.registerExtension({ // We've found the end inputNode = currentNode; inputType = node.outputs[link.origin_slot]?.type ?? null; + rootNode = node; break; } } else { @@ -123,6 +125,11 @@ app.registerExtension({ } } + if (rootNode?.constructor.type === "PrimitiveNode" && inputType === "*") { + // Primitive doesn't have type yet, skip update + return; + } + const displayType = (inputType === "*" && outputType) || inputType || outputType || "*"; const color = LGraphCanvas.link_type_colors[displayType]; diff --git a/web/extensions/core/widgetInputs.js b/web/extensions/core/widgetInputs.js index 6b5174968..8fd110bc4 100644 --- a/web/extensions/core/widgetInputs.js +++ b/web/extensions/core/widgetInputs.js @@ -210,7 +210,7 @@ app.registerExtension({ function get_links(node) { let links = []; - for (const l of node.outputs[0].links) { + for (const l of node.outputs[0].links ?? []) { const linkInfo = app.graph.links[l]; const n = node.graph.getNodeById(linkInfo.target_id); if (n.type == "Reroute") {