Skip to content

Commit b515ef0

Browse files
authored
Fix broken links on bypass prior to reroute (#5237)
1 parent 8eef1b7 commit b515ef0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ export class ExecutableNodeDTO implements ExecutableLGraphNode {
141141
*/
142142
resolveInput(
143143
slot: number,
144-
visited = new Set<string>()
144+
visited = new Set<string>(),
145+
type?: ISlotType
145146
): ResolvedInput | undefined {
146147
const uniqueId = `${this.subgraphNode?.subgraph.id}:${this.node.id}[I]${slot}`
147148
if (visited.has(uniqueId)) {
@@ -232,7 +233,11 @@ export class ExecutableNodeDTO implements ExecutableLGraphNode {
232233
`No output node DTO found for id [${outputNodeExecutionId}]`
233234
)
234235

235-
return outputNodeDto.resolveOutput(link.origin_slot, input.type, visited)
236+
return outputNodeDto.resolveOutput(
237+
link.origin_slot,
238+
type ?? input.type,
239+
visited
240+
)
236241
}
237242

238243
/**
@@ -284,7 +289,7 @@ export class ExecutableNodeDTO implements ExecutableLGraphNode {
284289

285290
// Upstreamed: Other virtual nodes are bypassed using the same input/output index (slots must match)
286291
if (node.isVirtualNode) {
287-
if (this.inputs.at(slot)) return this.resolveInput(slot, visited)
292+
if (this.inputs.at(slot)) return this.resolveInput(slot, visited, type)
288293

289294
// Fallback check for nodes performing link redirection
290295
const virtualLink = this.node.getInputLink(slot)

0 commit comments

Comments
 (0)