File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,6 @@ function COMFY_DYNAMICCOMBO_V3(
7575 addedWidget . name = `${ widget . name } .${ addedWidget . name } `
7676 }
7777 node . widgets . splice ( insertionPoint , 0 , ...addedWidgets )
78- node . size [ 1 ] = node . computeSize ( [ ...node . size ] ) [ 1 ]
7978 for ( const input of node . inputs . slice ( startingInputLength ) ) {
8079 input . name = `${ widget . name } .${ input . name } `
8180 if ( input . widget )
@@ -90,8 +89,17 @@ function COMFY_DYNAMICCOMBO_V3(
9089 throw new Error ( 'Failed to find input socket for ' + widget . name )
9190 return
9291 }
93- const addedInputs = node . spliceInputs ( startingInputLength )
92+ const addedInputs = node
93+ . spliceInputs ( startingInputLength )
94+ . filter (
95+ ( addedInput ) =>
96+ ! node . inputs . some (
97+ ( existingInput ) => addedInput . name === existingInput . name
98+ )
99+ )
100+ //assume existing inputs are in correct order
94101 node . spliceInputs ( inputInsertionPoint , 0 , ...addedInputs )
102+ node . size [ 1 ] = node . computeSize ( [ ...node . size ] ) [ 1 ]
95103 }
96104 //A little hacky, but onConfigure won't work.
97105 //It fires too late and is overly disruptive
You can’t perform that action at this time.
0 commit comments