Skip to content

Commit

Permalink
Load api workflow if regular workflow isn't in loaded image.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Dec 2, 2023
1 parent 88e2c97 commit b2517b4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1878,6 +1878,8 @@ export class ComfyApp {
if (pngInfo) {
if (pngInfo.workflow) {
await this.loadGraphData(JSON.parse(pngInfo.workflow));
} else if (pngInfo.prompt) {
this.loadApiJson(JSON.parse(pngInfo.prompt));
} else if (pngInfo.parameters) {
importA1111(this.graph, pngInfo.parameters);
}
Expand All @@ -1889,6 +1891,8 @@ export class ComfyApp {
this.loadGraphData(JSON.parse(pngInfo.workflow));
} else if (pngInfo.Workflow) {
this.loadGraphData(JSON.parse(pngInfo.Workflow)); // Support loading workflows from that webp custom node.
} else if (pngInfo.prompt) {
this.loadApiJson(JSON.parse(pngInfo.prompt));
}
}
} else if (file.type === "application/json" || file.name?.endsWith(".json")) {
Expand All @@ -1908,6 +1912,8 @@ export class ComfyApp {
const info = await getLatentMetadata(file);
if (info.workflow) {
await this.loadGraphData(JSON.parse(info.workflow));
} else if (info.prompt) {
this.loadApiJson(JSON.parse(info.prompt));
}
}
}
Expand Down

0 comments on commit b2517b4

Please sign in to comment.