Preserve image panel values during workflow restore

This commit is contained in:
Jony
2026-10-07 16:01:02 +08:00
parent 5212a59047
commit 532d4a9541
6 changed files with 142 additions and 6 deletions
+6 -2
View File
@@ -338,7 +338,11 @@ function hideBackendWidgets(node) {
hideBackendWidget(findWidget(node, name));
}
for (const widget of node?.widgets || []) {
if (isGeneratedSeedControl(widget)) hideBackendWidget(widget);
if (isGeneratedSeedControl(widget)) {
hideBackendWidget(widget);
// LiteGraph restores by widget.serialize; options.serialize only excludes API prompts.
widget.serialize = false;
}
}
}
@@ -4744,7 +4748,7 @@ function restorePanelFromWidgets(node) {
}
function serializeGeneratorWidgets(node, data) {
// LiteGraph stores even serialize:false UI widgets in workflows. Keep only schema widgets.
// options.serialize:false excludes prompts, not workflow values. Keep only schema widgets.
data.widgets_values = (node.widgets || [])
.filter(widget => BACKEND_WIDGETS.includes(widget.name) && widget.name !== "内容审查强度")
.map(widget => widget.value);