mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-02 03:30:04 +00:00
Add IBaseWidget.serialize flag (#915)
https://github.com/Comfy-Org/ComfyUI_frontend/pull/3323 Some widgets are only used for display purpose (The preview image widget), their value shouldn't be serialized into the workflow. This PR adds a flag to allow widget to skip value serialization.
This commit is contained in:
@@ -777,6 +777,7 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
|
||||
if (widgets && this.serialize_widgets) {
|
||||
o.widgets_values = []
|
||||
for (const [i, widget] of widgets.entries()) {
|
||||
if (widget.serialize === false) continue
|
||||
// @ts-expect-error #595 No-null
|
||||
o.widgets_values[i] = widget ? widget.value : null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user