mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-21 23:09:39 +00:00
Prevent widget value serialization for media preview widgets (#3370)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -238,9 +238,11 @@ class ImagePreviewWidget implements ICustomWidget {
|
||||
readonly type: 'custom'
|
||||
readonly name: string
|
||||
readonly options: IWidgetOptions<unknown>
|
||||
// Dummy value to satisfy type requirements
|
||||
/** Dummy value to satisfy type requirements. */
|
||||
value: string
|
||||
y: number = 0
|
||||
/** Don't serialize the widget value. */
|
||||
serialize: boolean = false
|
||||
|
||||
constructor(name: string, options: IWidgetOptions<unknown>) {
|
||||
this.type = 'custom'
|
||||
|
||||
Reference in New Issue
Block a user