Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fe7ec4d
feat: support dynamic combos and autogrow groups on subgraphs
DrJKL Nov 12, 2026
bad7e6c
test: cover autogrow group socket sync and link rejection
DrJKL Nov 12, 2026
e83eb51
test: update flux2 prompt snapshots for autogrow rows
DrJKL Nov 12, 2026
df9e97a
fix: align dynamic combo squash with rebased source stack
DrJKL Nov 12, 2026
6111be9
fix: ignore a hovered input that belongs to another node on drop
DrJKL Nov 12, 2026
9491eba
test: cover advanced sockets and whole-collection slot assertions
DrJKL Nov 12, 2026
1b72dae
fix: keep promoted dynamic inputs consistent across rewire and reload
DrJKL Nov 12, 2026
68d4115
test: run the save and load case through the app's post-load traversal
DrJKL Nov 12, 2026
3124ed3
test: cover promoting, selecting and disconnecting a dynamic combo
DrJKL Nov 12, 2026
5dafb42
test: load the dynamic combo workflow in beforeEach
DrJKL Nov 12, 2026
c70d25c
Merge remote-tracking branch 'origin/drjkl/in-subgraph-edits' into dr…
DrJKL Nov 13, 2026
aa57b6e
Merge branch 'drjkl/in-subgraph-edits' into drjkl/in-subgraph-edits-d…
DrJKL Nov 13, 2026
4be7d1d
Merge branch 'drjkl/in-subgraph-edits' into drjkl/in-subgraph-edits-d…
DrJKL Nov 13, 2026
726665c
Merge branch 'drjkl/in-subgraph-edits' into drjkl/in-subgraph-edits-d…
DrJKL Nov 13, 2026
1753fd4
Merge branch 'drjkl/in-subgraph-edits' into drjkl/in-subgraph-edits-d…
DrJKL Nov 13, 2026
a52099e
Merge branch 'drjkl/in-subgraph-edits' into drjkl/in-subgraph-edits-d…
DrJKL Nov 13, 2026
00bb64a
Merge branch 'drjkl/in-subgraph-edits' into drjkl/in-subgraph-edits-d…
DrJKL Nov 13, 2026
f410702
Merge branch 'drjkl/in-subgraph-edits' into drjkl/in-subgraph-edits-d…
DrJKL Nov 13, 2026
e83e208
Merge branch 'drjkl/in-subgraph-edits' into drjkl/in-subgraph-edits-d…
DrJKL Nov 13, 2026
4b45f0a
Merge remote-tracking branch 'origin/drjkl/in-subgraph-edits' into dr…
DrJKL Nov 14, 2026
8897016
Merge remote-tracking branch 'origin/drjkl/in-subgraph-edits' into dr…
DrJKL Nov 14, 2026
8f16b00
refactor: build WidgetGrid row classes in the row model
DrJKL Nov 14, 2026
3fc30d1
Merge remote-tracking branch 'origin/drjkl/in-subgraph-edits' into dr…
DrJKL Nov 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .fallow-baselines/health.json
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,9 @@
}
},
"src/lib/litegraph/src/subgraph/SubgraphInput.ts": {
"crap_high": {
"count": 1
},
"crap_moderate": {
"count": 1
}
Expand Down
4 changes: 2 additions & 2 deletions browser_tests/fixtures/agentAutogrowSpareInputFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ async function wireAutogrowNodeAndSwitchTabs(page: Page) {
page.evaluate((id) => {
const node = window.app!.graph.getNodeById(id)
return (node?.inputs ?? [])
.filter((input) => input.name.startsWith('model.images.'))
.map((input, index) => ({
name: input.name,
connected: node!.getInputLink(index) !== null
}))
.filter(({ name }) => name.startsWith('model.images.'))
}, toNodeId(GPT_NODE_ID))
const readNodeColor = () =>
page.evaluate((id) => {
Expand Down Expand Up @@ -256,7 +256,7 @@ async function wireAutogrowNodeAndSwitchTabs(page: Page) {
{ name: IMAGE_1_NAME, connected: true },
{ name: IMAGE_2_NAME, connected: false }
])
await expect(vueNodes.getInputSlotRow(gptNodeId, 1)).toContainText(
await expect(vueNodes.getInputSlotRow(gptNodeId, 2)).toContainText(
IMAGE_2_FRIENDLY_LABEL
)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test.describe(
test('still draws the free autogrow slot on the node after the switch', async ({
autogrow: { vueNodes, gptNodeId }
}) => {
await expect(vueNodes.getInputSlotRow(gptNodeId, 1)).toContainText(
await expect(vueNodes.getInputSlotRow(gptNodeId, 2)).toContainText(
'image_2'
)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ test.describe(
}) => {
await test.step('the node still shows its API-node color and friendly label', async () => {
await expect.poll(readNodeColor).toEqual(API_NODE_COLOR)
await expect(vueNodes.getInputSlotRow(gptNodeId, 0)).not.toContainText(
await expect(vueNodes.getInputSlotRow(gptNodeId, 1)).not.toContainText(
IMAGE_1_NAME
)
await expect(vueNodes.getInputSlotRow(gptNodeId, 0)).toContainText(
await expect(vueNodes.getInputSlotRow(gptNodeId, 1)).toContainText(
IMAGE_1_FRIENDLY_LABEL
)
await page
Expand Down
18 changes: 16 additions & 2 deletions browser_tests/tests/graph/autogrowRowAlignment.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@ test.describe(
`${REFERENCE_IMAGES_PREFIX}image_4`
)
expect(image4Index).toBeGreaterThanOrEqual(0)
await image4Source.connectOutput(0, referenceNode, image4Index)
await comfyPage.vueNodes
.getOutputSlotConnectionDot(String(image4Source.id), 0)
.dragTo(
comfyPage.vueNodes.getInputSlotConnectionDot(
AUTOGROW_REFERENCE_NODE_ID,
image4Index
)
)
const inputsAfterFourth = await getInputNames(
comfyPage,
AUTOGROW_REFERENCE_NODE_ID,
Expand All @@ -96,7 +103,14 @@ test.describe(
`${REFERENCE_IMAGES_PREFIX}image_5`
)
expect(image5Index).toBeGreaterThanOrEqual(0)
await image5Source.connectOutput(0, referenceNode, image5Index)
await comfyPage.vueNodes
.getOutputSlotConnectionDot(String(image5Source.id), 0)
.dragTo(
comfyPage.vueNodes.getInputSlotConnectionDot(
AUTOGROW_REFERENCE_NODE_ID,
image5Index
)
)
await comfyPage.nextFrame()

await expect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ test.describe(
await expect
.poll(() => getInputNames(comfyPage, AUTOGROW_NODE_ID, ''))
.toEqual([
'images',
'images.image0',
'images.image1',
'images.image2',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect } from '@playwright/test'

import { WidgetSelectDefaultFixture } from '@e2e/fixtures/components/WidgetSelectDefault'
import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage'
import { getInputNames } from '@e2e/fixtures/utils/nodeInputLinks'
import { getPromotedWidgetNames } from '@e2e/fixtures/utils/promotedWidgets'
Expand Down Expand Up @@ -53,3 +54,78 @@ test.describe(
})
}
)

test.describe(
'Promoted dynamic combo',
{ tag: ['@subgraph', '@widget', '@vue-nodes'] },
() => {
const INTERIOR_ID = '1'
const COMBO = 'resize_type'
const DIMENSION_INPUTS = [
COMBO,
`${COMBO}.width`,
`${COMBO}.height`,
`${COMBO}.crop`
]

test.beforeEach(async ({ comfyPage }) => {
await comfyPage.workflow.loadWorkflow('inputs/dynamic_combo')
})

test('moves its option inputs to the subgraph node until it is disconnected', async ({
comfyPage
}) => {
const resizeNode = await comfyPage.nodeOps.getNodeRefById(INTERIOR_ID)
await resizeNode.click('title')
const hostId = String((await resizeNode.convertToSubgraph()).id)
const host = comfyPage.vueNodes.getNodeLocator(hostId)
const interior = comfyPage.vueNodes.getNodeLocator(INTERIOR_ID)
const hostCombo = new WidgetSelectDefaultFixture(host, COMBO)
const interiorCombo = new WidgetSelectDefaultFixture(interior, COMBO)

await test.step('promote the combo from inside the subgraph', async () => {
await comfyPage.vueNodes.enterSubgraph(hostId)
await comfyPage.subgraph.promoteWidget(interior, COMBO)
await expect
.poll(() => getInputNames(comfyPage, INTERIOR_ID, COMBO))
.toEqual([COMBO])
await comfyPage.subgraph.exitViaBreadcrumb()

await expect(hostCombo.trigger).toHaveText('scale dimensions')
await expect
.poll(() => getInputNames(comfyPage, hostId, COMBO))
.toEqual(DIMENSION_INPUTS)
})

await test.step('select another option on the subgraph node', async () => {
await hostCombo.selectOption('scale by multiplier')

await expect
.poll(() => getInputNames(comfyPage, hostId, COMBO))
.toEqual([COMBO, `${COMBO}.multiplier`])
})

await test.step('disconnect the promoted input', async () => {
await comfyPage.vueNodes.enterSubgraph(hostId)
await comfyPage.subgraph.rightClickInputSlot(COMBO)
await comfyPage.contextMenu.clickLitegraphMenuItem('Disconnect Links')

await expect
.poll(() => getInputNames(comfyPage, INTERIOR_ID, COMBO))
.toEqual(DIMENSION_INPUTS)
await expect(interiorCombo.trigger).toHaveText('scale dimensions')
await expect(
comfyPage.vueNodes.getInputNumberControls(
comfyPage.vueNodes.getWidgetRowByLabel(interior, 'width')
).input
).toHaveValue('512')

await comfyPage.subgraph.exitViaBreadcrumb()
await expect(hostCombo.trigger).toHaveCount(0)
await expect
.poll(() => getInputNames(comfyPage, hostId, COMBO))
.toEqual([COMBO])
})
})
}
)
20 changes: 20 additions & 0 deletions browser_tests/tests/vueNodes/widgets/advancedWidgets.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,23 @@ test.describe('Advanced Widget Visibility', { tag: '@vue-nodes' }, () => {
await expect(node.getByText(SHOW_ADVANCED_INPUTS)).toBeHidden()
})
})

test.describe('Advanced socket-only input', { tag: '@vue-nodes' }, () => {
test('is hidden until advanced inputs are shown', async ({ comfyPage }) => {
const nodeRef = await comfyPage.nodeOps.addNode(
'DevToolsNodeWithAdvancedSocketInput',
{},
{ x: 500, y: 200 }
)
const node = comfyPage.vueNodes.getNodeByTitle(
'Node With Advanced Socket Input'
)
const maskRow = comfyPage.vueNodes.getInputSlotRow(String(nodeRef.id), 1)

await expect(maskRow).toHaveCount(0)
await node.getByText(SHOW_ADVANCED_INPUTS).click()
await expect(maskRow).toHaveCount(1)
await expect(maskRow.getByTestId('slot-dot')).toBeVisible()
await expect(maskRow).toHaveText('mask')
})
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions src/composables/videoConcat/syncConcatOrderWithLinks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@ function buildConcat({ widgetBeforeAdding = false } = {}) {
const source = new LGraphNode(title)
source.addOutput('VIDEO', 'VIDEO')
graph.add(source)
source.connect(0, concat, slot)
source.connect(0, concat, slotOf(concat, `0.video${slot}`))
}
return { concat, widget }
}

function slotOf(node: LGraphNode, name: string) {
return node.inputs.findIndex((input) => input.name === name)
}

function clipTitles(concat: LGraphNode, order: string[]) {
return order.flatMap((name) => {
const slot = concat.inputs.findIndex((input) => input.name === `0.${name}`)
Expand All @@ -64,11 +68,11 @@ describe('syncConcatOrderWithLinks', () => {
'green'
])

concat.disconnectInput(0)
concat.disconnectInput(slotOf(concat, '0.video0'))
await animationFrame()
await nextTick()

expect(concat.inputs[0].name).toBe('0.video0')
expect(concat.inputs[1].name).toBe('0.video0')
expect(clipTitles(concat, widget.value.order ?? [])).toEqual([
'blue',
'green'
Expand All @@ -83,7 +87,7 @@ describe('syncConcatOrderWithLinks', () => {
await nextTick()

concat.onRemoved?.()
concat.disconnectInput(0)
concat.disconnectInput(slotOf(concat, '0.video0'))
await animationFrame()
await nextTick()

Expand Down
23 changes: 14 additions & 9 deletions src/core/graph/subgraph/promotionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { IContextMenuValue } from '@/lib/litegraph/src/litegraph'
import { LGraphNode } from '@/lib/litegraph/src/litegraph'
import type { SubgraphNode } from '@/lib/litegraph/src/subgraph/SubgraphNode'
import type { LinkId } from '@comfyorg/graph-model/linkId'
import { hostInputOf } from '@/lib/litegraph/src/subgraph/hostInput'
import { reorderSubgraphInputs } from '@/lib/litegraph/src/subgraph/subgraphUtils'
import type { IBaseWidget } from '@comfyorg/graph-model/widgets'
import { nextUniqueName } from '@/lib/litegraph/src/strings'
Expand Down Expand Up @@ -155,7 +156,7 @@ export function reorderSubgraphInputsByWidgetOrder(
subgraphNode: SubgraphNode,
orderedWidgets: readonly Pick<IBaseWidget, 'widgetId'>[]
): void {
const remainingIndices = new Set(subgraphNode.inputs.keys())
const remainingIndices = new Set(subgraphNode.subgraph.inputs.keys())
const orderedIndices = orderedWidgets.flatMap((orderedWidget) => {
for (const index of remainingIndices) {
if (isSamePromotedInput(subgraphNode, index, orderedWidget)) {
Expand All @@ -175,8 +176,10 @@ function applySubgraphInputOrder(
subgraphNode: SubgraphNode,
orderedIndices: readonly number[]
): void {
const widgetValues = subgraphNode.inputs.map((input) => {
const id = input.widgetId
const hostInputAt = (index: number) =>
hostInputOf(subgraphNode, subgraphNode.subgraph.inputs[index])
const widgetValues = subgraphNode.subgraph.inputs.map((_, index) => {
const id = hostInputAt(index)?.widgetId
if (!id) return undefined
return useWidgetValueStore().getWidget(id)?.value
})
Expand All @@ -185,14 +188,16 @@ function applySubgraphInputOrder(
useWidgetValueStore().setNodeWidgetOrder(
subgraphNode.rootGraph.id,
subgraphNode.id,
subgraphNode.inputs.flatMap((input) =>
input.widgetId ? [input.widgetId] : []
)
subgraphNode.inputs.flatMap((input) => {
const id =
input.widgetId ?? subgraphNode.getWidgetFromSlot(input)?.widgetId
return id ? [id] : []
})
)

for (const [newIndex, oldIndex] of orderedIndices.entries()) {
const value = widgetValues[oldIndex]
const id = subgraphNode.inputs[newIndex]?.widgetId
const id = hostInputAt(newIndex)?.widgetId
if (value === undefined || !id) continue
useWidgetValueStore().setValue(id, value)
}
Expand All @@ -203,8 +208,8 @@ function isSamePromotedInput(
inputIndex: number,
orderedWidget: Pick<IBaseWidget, 'widgetId'>
): boolean {
const input = subgraphNode.inputs.at(inputIndex)
const linkedInput = input?._subgraphSlot
const linkedInput = subgraphNode.subgraph.inputs.at(inputIndex)
const input = hostInputOf(subgraphNode, linkedInput)
if (!input || !linkedInput) return false

for (const linkId of linkedInput.linkIds) {
Expand Down
1 change: 1 addition & 0 deletions src/core/graph/widgets/autogrowConvertToSubgraph.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ describe('Convert to Subgraph with a grown autogrow group (FE-3325)', () => {
test('wires the grown group ahead of mask and strength', () => {
const { node } = buildGraph()
expect(node.inputs.map((input) => input.name)).toEqual([
'images',
'images.image0',
'images.image1',
'images.image2',
Expand Down
Loading
Loading