@@ -166,6 +166,7 @@ export function applyDynamicInputs(
166166 inputSpec : InputSpecV2
167167) : boolean {
168168 if ( ! ( inputSpec . type in dynamicInputs ) ) return false
169+ //TODO: perform parsing/validation of inputSpec here?
169170 dynamicInputs [ inputSpec . type ] ( node , inputSpec )
170171 return true
171172}
@@ -233,7 +234,9 @@ export function applyMatchType(node: LGraphNode, inputSpec: InputSpecV2) {
233234 const { addNodeInput } = useLitegraphService ( )
234235 const name = inputSpec . name
235236 const { allowed_types, template_id } = (
236- inputSpec as { template : { allowed_types : string ; template_id : string } }
237+ inputSpec as InputSpecV2 & {
238+ template : { allowed_types : string ; template_id : string }
239+ }
237240 ) . template
238241 const typedSpec = { ...inputSpec , type : allowed_types }
239242 addNodeInput ( node , typedSpec )
@@ -259,6 +262,8 @@ export function applyMatchType(node: LGraphNode, inputSpec: InputSpecV2) {
259262 if ( ! matchGroup ) return
260263 if ( iscon && linf ) {
261264 const { output, subgraphInput } = linf . resolve ( this . graph )
265+ //TODO: fix this bug globally. A link type (and therefore color)
266+ //should be the combinedType of origin and target type
262267 const connectingType = ( output ?? subgraphInput ) ?. type
263268 if ( connectingType ) linf . type = connectingType
264269 }
@@ -302,6 +307,22 @@ export function applyMatchType(node: LGraphNode, inputSpec: InputSpecV2) {
302307 }
303308 augmentedNode . comfyMatchType [ template_id ] ??= { }
304309 augmentedNode . comfyMatchType [ template_id ] [ name ] = allowed_types
310+
311+ //TODO: instead apply on output add?
312+ //ensure outputs get updated
313+ const index = node . inputs . length - 1
314+ const input = node . inputs . at ( - 1 ) !
315+ setTimeout (
316+ ( ) =>
317+ node . onConnectionsChange ! (
318+ LiteGraph . INPUT ,
319+ index ,
320+ false ,
321+ undefined ,
322+ input
323+ ) ,
324+ 50
325+ )
305326}
306327
307328export function applyAutoGrow ( node : LGraphNode , inputSpec : InputSpecV2 ) {
0 commit comments