Description
Custom Node Testing
- I have tried disabling custom nodes and the issue persists (see how to disable custom nodes if you need help)
Frontend Version
ComfyUI_frontend v1.22.2-sub.10
Expected Behavior
Subgraph executes correctly.
Actual Behavior
An error is thrown (shown in toast): outputSlot is undefined
Steps to Reproduce
In a subgraph, have a node with more than 1 outputs connect its 1+ index'ed output to the subgraph output.
Here's a simple, non-custom example. Notice how it's the LoadImage's second output (MASK) that is connected.:
FWIW, here's a real-world example, where the user wants to export the image and the seed from the subgraph, each in an rgthree-custom Context node and, both, the 7th & 8th output index:
Debug Logs
N/A
Browser Logs
N/A
Setting JSON
N/A
What browsers do you use to access the UI ?
No response
Other Information
If you consider the workflow, we should see the tensor mask data in the display any:
So the problem lies here, it seems:
ComfyUI_frontend/src/utils/executionUtil.ts
Lines 126 to 140 in 1cf7126
What happens in the code, is the following:
- When evaluating the DisplayAny output
node
thelink
set on line 126 is fromDisplayAny.input[0] -> SubGraph.output[0]
with thelink.origin_slot
being 0. - We then get into line 133 because the
parent
is the Subgraph connected to the DisplayAnynode
. - And on line 134
link
is reevaluate and set to the Subgraphparent
input link for slot 0 which inside the subgraph which, in this example, is theLoadImage,output[1]
where the new link's origin_slot is now 1 (that's important) - Then, on line 138, this new
link.origin_slot
of 1 is sent to theparent.resolveSubgraphOutputLink
which fails because there is no "slot 1" of the Subgraph output.
┆Issue is synchronized with this Notion page by Unito