From 0e2df8a45ac355dc01a952e9b25dbedd41cd6486 Mon Sep 17 00:00:00 2001 From: byte911 <92360792+byte911@users.noreply.github.com> Date: Tue, 25 Jul 2023 10:50:30 +0800 Subject: [PATCH] Serialize the name of widget --- src/litegraph.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/litegraph.js b/src/litegraph.js index 86d58eff5..06fe01017 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -2590,12 +2590,16 @@ } if (this.widgets && this.serialize_widgets) { + o.widgets_names = []; o.widgets_values = []; for (var i = 0; i < this.widgets.length; ++i) { - if(this.widgets[i]) - o.widgets_values[i] = this.widgets[i].value; - else - o.widgets_values[i] = null; + if (this.widgets[i]) { + o.widgets_names[i] = this.widgets[i].name; + o.widgets_values[i] = this.widgets[i].value; + } else { + o.widgets_names[i] = null; + o.widgets_values[i] = null; + } } }