diff --git a/web/scripts/app.js b/web/scripts/app.js index 181c54800..49c562690 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -1009,8 +1009,10 @@ export class ComfyApp { loadGraphData(graphData) { this.clean(); + let reset_invalid_values = false; if (!graphData) { graphData = structuredClone(defaultGraph); + reset_invalid_values = true; } const missingNodeTypes = []; @@ -1096,6 +1098,13 @@ export class ComfyApp { } } } + if (reset_invalid_values) { + if (widget.type == "combo") { + if (!widget.options.values.includes(widget.value) && widget.options.values.length > 0) { + widget.value = widget.options.values[0]; + } + } + } } }