Skip to content

Conversation

AustinMroz
Copy link
Collaborator

@AustinMroz AustinMroz commented Sep 18, 2025

#5024 added support for connecting primitive nodes to subgraph inputs. To accomplish this, it pulls WidgetLocator information from the node owning the widget.

This node property does not exist on all IBaseWidget. toConcrete was used to instead have a BaseWidget which is guaranteed to have a node property. The issue that was missed, is that a widget which lacks this information (such as most implemented by custom nodes) sets the node value to the argument which was passed. Here that is the reference to the subgraph node. Sometimes, this #setWidget call is made multiple times, and when this occurs, the input.widget has itself set as the protoyep, throwing an error.

This is resolved by instead taking an additional input which is unambiguous.

For reference, this is a near minimal workflow using comfy_mtb that replicates the issue
cyclic.json

Special thanks to @melMass for assistance discovering this issue.

┆Issue is synchronized with this Notion page by Unito

Copy link

github-actions bot commented Sep 18, 2025

🎭 Playwright Test Results

⚠️ Tests passed with flaky tests

⏰ Completed at: 09/18/2025, 07:29:48 PM UTC

📈 Summary

  • Total Tests: 449
  • Passed: 419 ✅
  • Failed: 0
  • Flaky: 1 ⚠️
  • Skipped: 29 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 412 / ❌ 0 / ⚠️ 1 / ⏭️ 29
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 4 / ❌ 0 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

@AustinMroz AustinMroz marked this pull request as ready for review September 18, 2025 17:53
@AustinMroz AustinMroz requested a review from a team as a code owner September 18, 2025 17:53
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 18, 2025
The link has not yet been created at the time of this call, but the
target slot was helpfully already being passed as an input and was
simply ignored.
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Sep 18, 2025
Copy link
Contributor

@DrJKL DrJKL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤞🏻

@DrJKL
Copy link
Contributor

DrJKL commented Sep 18, 2025

(I still don't think prototype setting is ever the right move)

Copy link
Contributor

@christian-byrne christian-byrne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@christian-byrne
Copy link
Contributor

Wait to merge this until 1.28 is released, so we can backport onto 1.27

@christian-byrne christian-byrne added needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch area:subgraph 1.27 labels Sep 18, 2025
@christian-byrne christian-byrne merged commit eb664f4 into main Sep 18, 2025
37 checks passed
@christian-byrne christian-byrne deleted the austin/fix-cyclic-proto branch September 18, 2025 23:06
Copy link

@AustinMroz Backport to core/1.27 failed: Merge conflicts detected.

Please manually cherry-pick commit eb664f47afa4aadd4db1c78d802637e1affabbb8 to the core/1.27 branch.

Conflicting files
  • src/lib/litegraph/src/subgraph/SubgraphNode.ts

@christian-byrne
Copy link
Contributor

@AustinMroz I can do the cherry pick

christian-byrne pushed a commit that referenced this pull request Sep 19, 2025
To accomplish this, it pulls WidgetLocator information from the node
owning the widget.

This `node` property does not exist on all IBaseWidget. `toConcrete` was
used to instead have a BaseWidget which is guaranteed to have a node
property. The issue that was missed, is that a widget which lacks this
information (such as most implemented by custom nodes) sets the node
value to the argument which was passed. Here that is the reference to
the subgraph node. Sometimes, this `#setWidget` call is made multiple
times, and when this occurs, the `input.widget` has itself set as the
protoyep, throwing an error.

This is resolved by instead taking an additional input which is
unambiguous.

For reference, this is a near minimal workflow using comfy_mtb that
replicates the issue

[cyclic.json](https://github.com/user-attachments/files/22412187/cyclic.json)

Special thanks to @melMass for assistance discovering this issue.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5637-Fix-cyclic-prototype-errors-with-subgraphNodes-2726d73d365081fea356f5197e4c2b42)
by [Unito](https://www.unito.io)
christian-byrne pushed a commit that referenced this pull request Sep 19, 2025
To accomplish this, it pulls WidgetLocator information from the node
owning the widget.

This `node` property does not exist on all IBaseWidget. `toConcrete` was
used to instead have a BaseWidget which is guaranteed to have a node
property. The issue that was missed, is that a widget which lacks this
information (such as most implemented by custom nodes) sets the node
value to the argument which was passed. Here that is the reference to
the subgraph node. Sometimes, this `#setWidget` call is made multiple
times, and when this occurs, the `input.widget` has itself set as the
protoyep, throwing an error.

This is resolved by instead taking an additional input which is
unambiguous.

For reference, this is a near minimal workflow using comfy_mtb that
replicates the issue

[cyclic.json](https://github.com/user-attachments/files/22412187/cyclic.json)

Special thanks to @melMass for assistance discovering this issue.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5637-Fix-cyclic-prototype-errors-with-subgraphNodes-2726d73d365081fea356f5197e4c2b42)
by [Unito](https://www.unito.io)
christian-byrne added a commit that referenced this pull request Sep 19, 2025
Cherry-pick of PR #5637: Fix cyclic prototype errors with subgraphNodes

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5650-Hotfix-Fix-cyclic-prototype-errors-with-subgraphNodes-2736d73d365081238853d5b445d08e7f)
by [Unito](https://www.unito.io)

Co-authored-by: AustinMroz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.27 area:subgraph needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants