mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-30 04:50:04 +00:00
Fix subgraph conversion of primitives (#6606)
 ┆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:
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user