Skip to content

Commit eb7da26

Browse files
committed
Fix execution fails when slot numbers don't match
1 parent 63e4c0b commit eb7da26

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/executionUtil.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { LGraph, NodeId } from '@comfyorg/litegraph'
1+
import type { LGraph, LGraphNode, NodeId } from '@comfyorg/litegraph'
22
import { LGraphEventMode } from '@comfyorg/litegraph'
33

44
import type {
@@ -120,7 +120,7 @@ export const graphToPrompt = async (
120120

121121
// Store all node links
122122
for (const [i, input] of node.inputs.entries()) {
123-
let parent = node.getInputNode(i)
123+
let parent: LGraphNode | null | undefined = node.getInputNode(i)
124124
if (!parent) continue
125125

126126
let link = node.getInputLink(i)
@@ -135,7 +135,7 @@ export const graphToPrompt = async (
135135
if (!link) break
136136

137137
parent = parent.isSubgraphNode()
138-
? parent.getInputNodeFromSubgraph(link.target_slot)
138+
? parent.getOutputNodeFromSubgraph(link.origin_slot)
139139
: parent.getInputNode(link.target_slot)
140140

141141
if (!parent) break

0 commit comments

Comments
 (0)