From cb8d0ebccc93d3df6e00da1a57718a86d3dde300 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Mon, 3 Jun 2024 19:48:27 -0400 Subject: [PATCH] Don't load the view coordinates when loading a workflow from the history. I think this makes things slightly less annoying for some users. --- web/scripts/app.js | 4 ++-- web/scripts/ui.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/scripts/app.js b/web/scripts/app.js index 4dc011b9..f96d197a 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -1800,7 +1800,7 @@ export class ComfyApp { * @param {*} graphData A serialized graph object * @param { boolean } clean If the graph state, e.g. images, should be cleared */ - async loadGraphData(graphData, clean = true) { + async loadGraphData(graphData, clean = true, restore_view = true) { if (clean !== false) { this.clean(); } @@ -1836,7 +1836,7 @@ export class ComfyApp { try { this.graph.configure(graphData); - if (this.enableWorkflowViewRestore.value && graphData.extra?.ds) { + if (restore_view && this.enableWorkflowViewRestore.value && graphData.extra?.ds) { this.canvas.ds.offset = graphData.extra.ds.offset; this.canvas.ds.scale = graphData.extra.ds.scale; } diff --git a/web/scripts/ui.js b/web/scripts/ui.js index 36fed323..72e43d35 100644 --- a/web/scripts/ui.js +++ b/web/scripts/ui.js @@ -228,7 +228,7 @@ class ComfyList { $el("button", { textContent: "Load", onclick: async () => { - await app.loadGraphData(item.prompt[3].extra_pnginfo.workflow); + await app.loadGraphData(item.prompt[3].extra_pnginfo.workflow, true, false); if (item.outputs) { app.nodeOutputs = item.outputs; }