mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-29 08:47:31 +00:00
fix: reset canvas graph before cleaning workflow load
Amp-Thread-ID: https://ampcode.com/threads/T-019d0283-9968-71ae-8051-382712e0e360 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -1133,13 +1133,15 @@ export class ComfyApp {
|
||||
useMissingModelStore().clearMissingModels()
|
||||
|
||||
if (clean !== false) {
|
||||
// Reset canvas context before configuring a new graph so subgraph UI
|
||||
// state from the previous workflow cannot leak into the newly loaded
|
||||
// one, and so `clean()` can clear the root graph even when the user is
|
||||
// currently inside a subgraph.
|
||||
this.canvas.setGraph(this.rootGraph)
|
||||
|
||||
this.clean()
|
||||
}
|
||||
|
||||
// Reset canvas context before configuring a new graph so subgraph UI state
|
||||
// from the previous workflow cannot leak into the newly loaded one.
|
||||
this.canvas.setGraph(this.rootGraph)
|
||||
|
||||
let reset_invalid_values = false
|
||||
// Use explicit validation instead of falsy check to avoid replacing
|
||||
// valid but falsy values (empty objects, 0, false, etc.)
|
||||
|
||||
Reference in New Issue
Block a user