Don't load the view coordinates when loading a workflow from the history.

I think this makes things slightly less annoying for some users.
This commit is contained in:
comfyanonymous 2024-06-03 19:48:27 -04:00
parent 809cc85a8e
commit cb8d0ebccc
2 changed files with 3 additions and 3 deletions

View File

@ -1800,7 +1800,7 @@ export class ComfyApp {
* @param {*} graphData A serialized graph object * @param {*} graphData A serialized graph object
* @param { boolean } clean If the graph state, e.g. images, should be cleared * @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) { if (clean !== false) {
this.clean(); this.clean();
} }
@ -1836,7 +1836,7 @@ export class ComfyApp {
try { try {
this.graph.configure(graphData); 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.offset = graphData.extra.ds.offset;
this.canvas.ds.scale = graphData.extra.ds.scale; this.canvas.ds.scale = graphData.extra.ds.scale;
} }

View File

@ -228,7 +228,7 @@ class ComfyList {
$el("button", { $el("button", {
textContent: "Load", textContent: "Load",
onclick: async () => { 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) { if (item.outputs) {
app.nodeOutputs = item.outputs; app.nodeOutputs = item.outputs;
} }