Skip to content

Conversation

AustinMroz
Copy link
Collaborator

@AustinMroz AustinMroz commented Aug 15, 2025

Had a clever idea which greatly simplifies the logic of nesting here. This patch is now entirely usable, and, in my opinion, worth releasing, but I've noticed a little spottyness with testing of swapped connections to partially matching types (FLOAT to FLOAT with different max/min)

subgraph-primitives

Resolves #5000

┆Issue is synchronized with this Notion page by Unito

Copy link

github-actions bot commented Aug 15, 2025

⚠️ Warnings

⚠️ Warning: E2E Test Coverage Missing

If this PR modifies behavior that can be covered by browser-based E2E tests, those tests are required. PRs lacking applicable test coverage may not be reviewed until added. Please add or update browser tests to ensure code quality and prevent regressions.

⚠️ Warning: Visual Documentation Missing

If this PR changes user-facing behavior, visual proof (screen recording or screenshot) is required. PRs without applicable visual documentation may not be reviewed until provided.
You can add it by:

  • GitHub: Drag & drop media directly into the PR description

  • YouTube: Include a link to a short demo

@AustinMroz AustinMroz force-pushed the austin/subgraph-primitive-widgets branch from f687e1c to 5c7cf93 Compare August 29, 2025 03:18
Copy link

github-actions bot commented Aug 29, 2025

🎭 Playwright Test Results

Tests completed successfully!

⏰ Completed at: 09/11/2025, 01:50:56 PM UTC

📊 Test Reports by Browser


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

@AustinMroz AustinMroz marked this pull request as ready for review August 29, 2025 03:21
@AustinMroz AustinMroz requested a review from a team as a code owner August 29, 2025 03:21
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 29, 2025
@AustinMroz AustinMroz force-pushed the austin/subgraph-primitive-widgets branch from 5c7cf93 to 55063c1 Compare August 29, 2025 03:56
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Sep 2, 2025
christian-byrne
christian-byrne previously approved these changes Sep 3, 2025
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, remaining comments are just nits

@christian-byrne
Copy link
Contributor

@AustinMroz
Copy link
Collaborator Author

I do! I'm quite a fan of it and have made use of it in most of the PRs I open. In this case, I didn't have a full fix when I opened the PR as draft and forgot to edit it when I returned to the issue. I try to err on the side of caution with declaring an issue fixed when a PR is only a partial solution.

@christian-byrne
Copy link
Contributor

Anything blocking on this PR?

@AustinMroz
Copy link
Collaborator Author

All the feedback was nonblocking nits. With webfiltered's beautiful PR (and a forgotten warning comment), it's solidly GTM.

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 christian-byrne merged commit 68845ce into main Sep 11, 2025
21 checks passed
@christian-byrne christian-byrne deleted the austin/subgraph-primitive-widgets branch September 11, 2025 21:27
snomiao pushed a commit that referenced this pull request Sep 12, 2025
* Fix connection of primitives to subgraphNodes

* Fix loading and nested subgraphs with primitives

Medium hackyness, but this saves ~100 lines.

* Use improved type check

* Remove requirement for type assertion

* Add warning comment

---------

Co-authored-by: filtered <[email protected]>
christian-byrne pushed a commit that referenced this pull request 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](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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:subgraph size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Primitive nodes do not detect a connection to subgraph inputs
4 participants