@@ -6,7 +6,7 @@ import { useNodeImageUpload } from '@/composables/node/useNodeImageUpload'
66import { useValueTransform } from '@/composables/useValueTransform'
77import { t } from '@/i18n'
88import type { ResultItem } from '@/schemas/apiSchema'
9- import type { InputSpec } from '@/schemas/nodeDefSchema'
9+ import type { ComboInputOptions , InputSpec } from '@/schemas/nodeDefSchema'
1010import type { ComfyWidgetConstructor } from '@/scripts/widgets'
1111import { useNodeOutputStore } from '@/stores/imagePreviewStore'
1212import { createAnnotatedPath } from '@/utils/formatUtil'
@@ -33,7 +33,7 @@ export const useImageUploadWidget = () => {
3333 inputName : string ,
3434 inputData : InputSpec
3535 ) => {
36- const inputOptions = inputData [ 1 ] ?? { }
36+ const inputOptions = ( inputData [ 1 ] ?? { } ) as ComboInputOptions
3737 const { imageInputName, allow_batch, image_folder = 'input' } = inputOptions
3838 const nodeOutputStore = useNodeOutputStore ( )
3939
@@ -43,11 +43,9 @@ export const useImageUploadWidget = () => {
4343 const { showPreview } = isVideo ? useNodeVideo ( node ) : useNodeImage ( node )
4444
4545 const fileFilter = isVideo ? isVideoFile : isImageFile
46- // @ts -expect-error InputSpec is not typed correctly
47- const fileComboWidget = findFileComboWidget ( node , imageInputName )
46+ const fileComboWidget = findFileComboWidget ( node , imageInputName ?? '' )
4847 const initialFile = `${ fileComboWidget . value } `
4948 const formatPath = ( value : InternalFile ) =>
50- // @ts -expect-error InputSpec is not typed correctly
5149 createAnnotatedPath ( value , { rootFolder : image_folder } )
5250
5351 const transform = ( internalValue : InternalValue ) : ExposedValue => {
@@ -67,7 +65,6 @@ export const useImageUploadWidget = () => {
6765
6866 // Setup file upload handling
6967 const { openFileSelection } = useNodeImageUpload ( node , {
70- // @ts -expect-error InputSpec is not typed correctly
7168 allow_batch,
7269 fileFilter,
7370 accept,
0 commit comments