mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +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()
|
useMissingModelStore().clearMissingModels()
|
||||||
|
|
||||||
if (clean !== false) {
|
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()
|
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
|
let reset_invalid_values = false
|
||||||
// Use explicit validation instead of falsy check to avoid replacing
|
// Use explicit validation instead of falsy check to avoid replacing
|
||||||
// valid but falsy values (empty objects, 0, false, etc.)
|
// valid but falsy values (empty objects, 0, false, etc.)
|
||||||
|
|||||||
Reference in New Issue
Block a user