Prevent widget value serialization for media preview widgets (#3370)

This commit is contained in:
Chenlei Hu
2025-04-09 17:01:02 -04:00
committed by GitHub
parent 2dc33b1eb9
commit dc9ea44f3a
6 changed files with 27 additions and 6 deletions

View File

@@ -39,6 +39,7 @@ export function useNodeAnimatedImage() {
}) as IWidget & {
options: { host: ReturnType<typeof createImageHost> }
}
widget.serialize = false
widget.serializeValue = () => undefined
widget.options.host.updateImages(node.imgs)
}

View File

@@ -155,9 +155,9 @@ export const useNodeVideo = (node: LGraphNode) => {
const hasWidget = node.widgets?.some((w) => w.name === VIDEO_WIDGET_NAME)
if (!hasWidget) {
const widget = node.addDOMWidget(VIDEO_WIDGET_NAME, 'video', container, {
hideOnZoom: false,
serialize: false
hideOnZoom: false
})
widget.serialize = false
widget.computeLayoutSize = () => ({
minHeight,
minWidth