diff --git a/src/extensions/core/widgetInputs.ts b/src/extensions/core/widgetInputs.ts index 85054aba5..62f1244b7 100644 --- a/src/extensions/core/widgetInputs.ts +++ b/src/extensions/core/widgetInputs.ts @@ -168,16 +168,14 @@ export class PrimitiveNode extends LGraphNode { #onFirstConnection(recreating?: boolean) { // First connection can fire before the graph is ready on initial load so random things can be missing - if (!this.outputs[0].links) { + if (!this.outputs[0].links || !this.graph) { this.onLastDisconnect() return } const linkId = this.outputs[0].links[0] - // @ts-expect-error fixme ts strict error const link = this.graph.links[linkId] if (!link) return - // @ts-expect-error fixme ts strict error const theirNode = this.graph.getNodeById(link.target_id) if (!theirNode || !theirNode.inputs) return diff --git a/src/lib/litegraph/src/LGraph.ts b/src/lib/litegraph/src/LGraph.ts index 3a5ce49f4..4678576a5 100644 --- a/src/lib/litegraph/src/LGraph.ts +++ b/src/lib/litegraph/src/LGraph.ts @@ -1566,6 +1566,8 @@ export class LGraph const subgraph = this.createSubgraph(data) subgraph.configure(data) + for (const node of subgraph.nodes) node.onGraphConfigured?.() + for (const node of subgraph.nodes) node.onAfterGraphConfigured?.() // Position the subgraph input nodes subgraph.inputNode.arrange()