55 LGraphNode ,
66 LiteGraph
77} from '@comfyorg/litegraph'
8- import type { IWidget , Vector2 } from '@comfyorg/litegraph'
8+ import type { Vector2 } from '@comfyorg/litegraph'
9+ import type { IBaseWidget } from '@comfyorg/litegraph/dist/types/widgets'
910import _ from 'lodash'
1011import type { ToastMessageOptions } from 'primevue/toast'
1112import { reactive } from 'vue'
@@ -94,7 +95,7 @@ function sanitizeNodeName(string: string) {
9495}
9596
9697type Clipspace = {
97- widgets ?: Pick < IWidget , 'type' | 'name' | 'value' > [ ] | null
98+ widgets ?: Pick < IBaseWidget , 'type' | 'name' | 'value' > [ ] | null
9899 imgs ?: HTMLImageElement [ ] | null
99100 original_imgs ?: HTMLImageElement [ ] | null
100101 images ?: any [ ] | null
@@ -387,7 +388,6 @@ export class ComfyApp {
387388 const index = node . widgets . findIndex ( ( obj ) => obj . name === 'image' )
388389 if ( index >= 0 ) {
389390 if (
390- // @ts -expect-error custom widget type
391391 node . widgets [ index ] . type != 'image' &&
392392 typeof node . widgets [ index ] . value == 'string' &&
393393 clip_image . filename
@@ -409,7 +409,6 @@ export class ComfyApp {
409409 )
410410 if ( prop && prop . type != 'button' ) {
411411 if (
412- // @ts -expect-error Custom widget type
413412 prop . type != 'image' &&
414413 typeof prop . value == 'string' &&
415414 // @ts -expect-error Custom widget value
@@ -421,7 +420,6 @@ export class ComfyApp {
421420 resultItem . filename +
422421 ( resultItem . type ? ` [${ resultItem . type } ]` : '' )
423422 } else {
424- // @ts -expect-error fixme ts strict error
425423 prop . value = value
426424 prop . callback ?.( value )
427425 }
@@ -1101,10 +1099,8 @@ export class ComfyApp {
11011099 ) {
11021100 if ( widget . name == 'control_after_generate' ) {
11031101 if ( widget . value === true ) {
1104- // @ts -expect-error string is not assignable to boolean
11051102 widget . value = 'randomize'
11061103 } else if ( widget . value === false ) {
1107- // @ts -expect-error string is not assignable to boolean
11081104 widget . value = 'fixed'
11091105 }
11101106 }
@@ -1535,10 +1531,8 @@ export class ComfyApp {
15351531 for ( const widget of node . widgets ) {
15361532 if ( widget . type === 'combo' ) {
15371533 if ( def [ 'input' ] . required ?. [ widget . name ] !== undefined ) {
1538- // @ts -expect-error Requires discriminated union
15391534 widget . options . values = def [ 'input' ] . required [ widget . name ] [ 0 ]
15401535 } else if ( def [ 'input' ] . optional ?. [ widget . name ] !== undefined ) {
1541- // @ts -expect-error Requires discriminated union
15421536 widget . options . values = def [ 'input' ] . optional [ widget . name ] [ 0 ]
15431537 }
15441538 }
0 commit comments