@@ -342,7 +342,27 @@ export function templateCompositeFrom(description) {
342
342
}
343
343
} ) ;
344
344
345
- const inputMetadata = getStaticInputMetadata ( inputOptions ) ;
345
+ const inputMapping = { } ;
346
+ if ( 'inputs' in description ) {
347
+ for ( const [ name , token ] of Object . entries ( description . inputs ) ) {
348
+ const tokenValue = getInputTokenValue ( token ) ;
349
+ if ( name in inputOptions ) {
350
+ if ( typeof inputOptions [ name ] === 'string' ) {
351
+ inputMapping [ name ] = input . dependency ( inputOptions [ name ] ) ;
352
+ } else {
353
+ inputMapping [ name ] = inputOptions [ name ] ;
354
+ }
355
+ } else if ( tokenValue . defaultValue ) {
356
+ inputMapping [ name ] = input . value ( tokenValue . defaultValue ) ;
357
+ } else if ( tokenValue . defaultDependency ) {
358
+ inputMapping [ name ] = input . dependency ( tokenValue . defaultDependency ) ;
359
+ } else {
360
+ inputMapping [ name ] = input . value ( null ) ;
361
+ }
362
+ }
363
+ }
364
+
365
+ const inputMetadata = getStaticInputMetadata ( inputMapping ) ;
346
366
347
367
const expectedOutputNames =
348
368
( Array . isArray ( description . outputs )
@@ -414,25 +434,6 @@ export function templateCompositeFrom(description) {
414
434
}
415
435
416
436
if ( 'inputs' in description ) {
417
- const inputMapping = { } ;
418
-
419
- for ( const [ name , token ] of Object . entries ( description . inputs ) ) {
420
- const tokenValue = getInputTokenValue ( token ) ;
421
- if ( name in inputOptions ) {
422
- if ( typeof inputOptions [ name ] === 'string' ) {
423
- inputMapping [ name ] = input . dependency ( inputOptions [ name ] ) ;
424
- } else {
425
- inputMapping [ name ] = inputOptions [ name ] ;
426
- }
427
- } else if ( tokenValue . defaultValue ) {
428
- inputMapping [ name ] = input . value ( tokenValue . defaultValue ) ;
429
- } else if ( tokenValue . defaultDependency ) {
430
- inputMapping [ name ] = input . dependency ( tokenValue . defaultDependency ) ;
431
- } else {
432
- inputMapping [ name ] = input . value ( null ) ;
433
- }
434
- }
435
-
436
437
finalDescription . inputMapping = inputMapping ;
437
438
finalDescription . inputDescriptions = description . inputs ;
438
439
}
0 commit comments