Skip to content

Commit

Permalink
Don't load the view coordinates when loading a workflow from the hist…
Browse files Browse the repository at this point in the history
…ory.

I think this makes things slightly less annoying for some users.
  • Loading branch information
comfyanonymous committed Jun 3, 2024
1 parent 809cc85 commit cb8d0eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions web/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion web/scripts/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cb8d0eb

Please sign in to comment.