Skip to content

Commit 61c5bfa

Browse files
AustinMrozDrJKL
authored andcommitted
Workaround for edge case with out of order inputs
1 parent 0d8338f commit 61c5bfa

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/core/graph/widgets/dynamicWidgets.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,14 @@ function COMFY_DYNAMICCOMBO_V3(
8484
}
8585
const addedInputs = node
8686
.spliceInputs(startingInputLength)
87-
.filter(
88-
(addedInput) =>
89-
!node.inputs.some(
90-
(existingInput) => addedInput.name === existingInput.name
91-
)
92-
)
87+
.map((addedInput) => {
88+
const existingInput = node.inputs.findIndex(
89+
(existingInput) => addedInput.name === existingInput.name
90+
)
91+
return existingInput === -1
92+
? addedInput
93+
: node.spliceInputs(existingInput, 1)[0]
94+
})
9395
//assume existing inputs are in correct order
9496
node.spliceInputs(inputInsertionPoint, 0, ...addedInputs)
9597
node.size[1] = node.computeSize([...node.size])[1]

0 commit comments

Comments
 (0)