mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
Don't serialize file upload and video preview widgets (#2689)
This commit is contained in:
@@ -136,7 +136,8 @@ export const useNodeVideo = (node: LGraphNode) => {
|
|||||||
const hasWidget = node.widgets?.some((w) => w.name === VIDEO_WIDGET_NAME)
|
const hasWidget = node.widgets?.some((w) => w.name === VIDEO_WIDGET_NAME)
|
||||||
if (!hasWidget) {
|
if (!hasWidget) {
|
||||||
node.addDOMWidget(VIDEO_WIDGET_NAME, 'video', container, {
|
node.addDOMWidget(VIDEO_WIDGET_NAME, 'video', container, {
|
||||||
hideOnZoom: false
|
hideOnZoom: false,
|
||||||
|
serialize: false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,12 +76,16 @@ export const useImageUploadWidget = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Create the button widget for selecting the files
|
// Create the button widget for selecting the files
|
||||||
const uploadWidget = node.addWidget('button', inputName, 'image', () =>
|
const uploadWidget = node.addWidget(
|
||||||
openFileSelection()
|
'button',
|
||||||
|
inputName,
|
||||||
|
'image',
|
||||||
|
() => openFileSelection(),
|
||||||
|
{
|
||||||
|
serialize: false
|
||||||
|
}
|
||||||
)
|
)
|
||||||
uploadWidget.label = 'choose file to upload'
|
uploadWidget.label = 'choose file to upload'
|
||||||
// @ts-expect-error serialize is not typed
|
|
||||||
uploadWidget.serialize = false
|
|
||||||
|
|
||||||
// TODO: Explain this?
|
// TODO: Explain this?
|
||||||
// @ts-expect-error LGraphNode.callback is not typed
|
// @ts-expect-error LGraphNode.callback is not typed
|
||||||
|
|||||||
Reference in New Issue
Block a user