From eb7da26dfe02a3d53b1f6cd4b170bedc81567054 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Mon, 16 Jun 2025 15:48:02 -0700 Subject: [PATCH] Fix execution fails when slot numbers don't match --- src/utils/executionUtil.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/executionUtil.ts b/src/utils/executionUtil.ts index 9d7d8505f..480ecee61 100644 --- a/src/utils/executionUtil.ts +++ b/src/utils/executionUtil.ts @@ -1,4 +1,4 @@ -import type { LGraph, NodeId } from '@comfyorg/litegraph' +import type { LGraph, LGraphNode, NodeId } from '@comfyorg/litegraph' import { LGraphEventMode } from '@comfyorg/litegraph' import type { @@ -120,7 +120,7 @@ export const graphToPrompt = async ( // Store all node links for (const [i, input] of node.inputs.entries()) { - let parent = node.getInputNode(i) + let parent: LGraphNode | null | undefined = node.getInputNode(i) if (!parent) continue let link = node.getInputLink(i) @@ -135,7 +135,7 @@ export const graphToPrompt = async ( if (!link) break parent = parent.isSubgraphNode() - ? parent.getInputNodeFromSubgraph(link.target_slot) + ? parent.getOutputNodeFromSubgraph(link.origin_slot) : parent.getInputNode(link.target_slot) if (!parent) break