fix: suppress control_after_generate when widget input is linked#10219
fix: suppress control_after_generate when widget input is linked#10219artokun wants to merge 8 commits intoComfy-Org:mainfrom
Conversation
When an external node is connected to a SubgraphNode input, the promoted widget's control_after_generate combo should not be active since the external node owns the value. The interior node's control widget was being exposed via linkedWidgets delegation regardless of connection state. Fixes Comfy-Org#10218
📝 WalkthroughWalkthroughAdds detection for widgets whose values are externally driven (including subgraph-promoted inputs), prevents applying control widgets in those cases, updates Vue widget rendering to omit controlWidget for linked slots, and adds unit and browser tests validating control_after_generate behavior across node and subgraph scenarios. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as UI (Widget)
participant Node as Node
participant Subgraph as SubgraphNode
participant Graph as Graph
UI->>Node: render widget / request control applicability
Node->>Graph: check input links for targetWidget
Graph-->>Node: link info (direct or via SubgraphInput)
alt link originates from SubgraphInput
Node->>Subgraph: traverse to parent node / check external linkage
Subgraph-->>Node: external link found / not found
end
Node-->>UI: isControlExternallyDriven = true|false
alt externally driven
UI-->>UI: omit controlWidget (undefined)
else not externally driven
UI-->>UI: attach controlWidget (apply control_after_generate)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎭 Playwright: ⏳ Running... |
Hide the control widget UI (NodeWidgets.vue) and skip its execution (isControlExternallyDriven in widgets.ts) when the widget's input has an active link. For subgraph interior nodes, traces the link chain through SubgraphInput to the SubgraphNode to detect external links. Fixes Comfy-Org#10218
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@browser_tests/tests/subgraphControlAfterGenerate.spec.ts`:
- Around line 50-53: The current guard uses test.skip when setup is falsy which
masks failures; replace the test.skip(...) branches with an immediate test
failure by throwing an Error (e.g., throw new Error('Could not create Int
nodes') ) or calling the test runner's fail mechanism so the test fails fast;
update both occurrences that check the setup variable (the blocks using "if
(!setup) { test.skip(...)" ) to throw an Error with a clear message instead of
skipping.
- Around line 39-43: The test currently finds controlWidget via
targetWidget?.linkedWidgets?.find(...) and silently skips configuration if it's
missing; update the test to assert that controlWidget exists before mutating it
(e.g., throw or use your test framework's expect) so the test fails if the
'control_after_generate' linked widget isn't present; apply the same presence
assertion and configuration for the other occurrence around the code referenced
at lines 111-115. Ensure you reference the variables controlWidget,
targetWidget, linkedWidgets and the widget name 'control_after_generate' when
adding the assertion.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8758c4a1-5bca-4a2b-847f-5e936520eef0
📒 Files selected for processing (4)
browser_tests/tests/subgraphControlAfterGenerate.spec.tssrc/renderer/extensions/vueNodes/components/NodeWidgets.vuesrc/scripts/widgets.test.tssrc/scripts/widgets.ts

Summary
control_after_generatecombo widget on the promoted viewProblem
Promoted subgraph widgets (Int, seed, float) expose the interior node's
control_after_generatewidget regardless of connection state. When an external node drives the input, the user sees two independent controls — one on the external node and one on the promoted widget — with potentially conflicting modes (e.g. external is "fixed" but promoted shows "randomize").Solution
Override
linkedWidgetsonPromotedWidgetViewto returnundefinedwhen the corresponding SubgraphNode input has an active link. This hides the control combo from the promoted widget when the value is externally driven.Video of Fix
Screen.Recording.2026-03-17.at.4.15.30.PM.mov
Test plan
Unit test:
linkedWidgets is suppressed when input has an external linkManual: connect Int node to subgraph input, verify control widget disappears from promoted view
Manual: disconnect Int node, verify control widget reappears
Fixes Promoted subgraph widget doesn't mirror control_after_generate from source #10218
┆Issue is synchronized with this Notion page by Unito