@@ -393,12 +393,21 @@ function comfyBuildParams(callback) {
393
393
if ( node . class_type . startsWith ( 'SwarmInput' ) && node . class_type != 'SwarmInputGroup' ) {
394
394
let type = '' ;
395
395
let subtype = null ;
396
+ let defaultVal = node . inputs [ 'value' ] ;
396
397
switch ( node . class_type ) {
397
398
case 'SwarmInputInteger' : type = 'integer' ; break ;
398
399
case 'SwarmInputFloat' : type = 'decimal' ; break ;
399
400
case 'SwarmInputText' : type = 'text' ; break ;
400
- case 'SwarmInputModelName' : type = 'model' ; subtype = node . inputs [ 'subtype' ] ; break ;
401
- case 'SwarmInputCheckpoint' : type = 'model' ; subtype = 'Stable-Diffusion' ; break ;
401
+ case 'SwarmInputModelName' :
402
+ type = 'model' ;
403
+ subtype = node . inputs [ 'subtype' ] ;
404
+ defaultVal = defaultVal . replaceAll ( '\\' , '/' ) . replaceAll ( '.safetensors' , '' ) ;
405
+ break ;
406
+ case 'SwarmInputCheckpoint' :
407
+ type = 'model' ;
408
+ subtype = 'Stable-Diffusion' ;
409
+ defaultVal = defaultVal . replaceAll ( '\\' , '/' ) . replaceAll ( '.safetensors' , '' ) ;
410
+ break ;
402
411
case 'SwarmInputDropdown' : type = 'dropdown' ; break ;
403
412
case 'SwarmInputBoolean' : type = 'boolean' ; break ;
404
413
case 'SwarmInputImage' : type = 'image' ; break ;
@@ -429,7 +438,7 @@ function comfyBuildParams(callback) {
429
438
type : type ,
430
439
subtype : subtype ,
431
440
description : node . inputs [ 'description' ] ,
432
- default : node . inputs [ 'value' ] ,
441
+ default : defaultVal ,
433
442
values : type == 'dropdown' ? node . inputs [ 'values' ] . split ( ',' ) . map ( s => s . trim ( ) ) : null ,
434
443
view_type : node . inputs [ 'view_type' ] ,
435
444
min : node . inputs [ 'min' ] || 0 ,
0 commit comments