Fix subgraph conversion of primitives (#6606)

![AnimateDiff_00001](https://github.com/user-attachments/assets/a40db1c7-5f0e-43b2-a7fc-a324188a3930)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6606-Fix-subgraph-conversion-of-primitives-2a36d73d3650818e9e74dd383a7f9007)
by [Unito](https://www.unito.io)
This commit is contained in:
AustinMroz
2025-11-12 12:25:43 -08:00
committed by GitHub
parent 1e71eae177
commit cfbd5361d3
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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()