From 6f3b99209eb08804b8838a638aca0f0f66422d24 Mon Sep 17 00:00:00 2001 From: bymyself Date: Sun, 23 Feb 2025 08:12:45 -0700 Subject: [PATCH] Don't serialize file upload and video preview widgets (#2689) --- src/composables/useNodeImage.ts | 3 ++- src/composables/widgets/useImageUploadWidget.ts | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/composables/useNodeImage.ts b/src/composables/useNodeImage.ts index 0919535ac..bd938e213 100644 --- a/src/composables/useNodeImage.ts +++ b/src/composables/useNodeImage.ts @@ -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 }) } } diff --git a/src/composables/widgets/useImageUploadWidget.ts b/src/composables/widgets/useImageUploadWidget.ts index f76238895..fd7de68a1 100644 --- a/src/composables/widgets/useImageUploadWidget.ts +++ b/src/composables/widgets/useImageUploadWidget.ts @@ -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