Don't serialize file upload and video preview widgets (#2689)

This commit is contained in:
bymyself
2025-02-23 08:12:45 -07:00
committed by GitHub
parent f7ee6861f1
commit 6f3b99209e
2 changed files with 10 additions and 5 deletions

View File

@@ -136,7 +136,8 @@ export const useNodeVideo = (node: LGraphNode) => {
const hasWidget = node.widgets?.some((w) => w.name === VIDEO_WIDGET_NAME)
if (!hasWidget) {
node.addDOMWidget(VIDEO_WIDGET_NAME, 'video', container, {
hideOnZoom: false
hideOnZoom: false,
serialize: false
})
}
}

View File

@@ -76,12 +76,16 @@ export const useImageUploadWidget = () => {
})
// Create the button widget for selecting the files
const uploadWidget = node.addWidget('button', inputName, 'image', () =>
openFileSelection()
const uploadWidget = node.addWidget(
'button',
inputName,
'image',
() => openFileSelection(),
{
serialize: false
}
)
uploadWidget.label = 'choose file to upload'
// @ts-expect-error serialize is not typed
uploadWidget.serialize = false
// TODO: Explain this?
// @ts-expect-error LGraphNode.callback is not typed