Update default workflows

This commit is contained in:
space-nuko
2023-05-22 21:15:01 -05:00
parent 42caa8bb42
commit a3259898e9
3 changed files with 7282 additions and 6763 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -208,7 +208,8 @@ export default class ComfyApp {
// We failed to restore a workflow so load the default // We failed to restore a workflow so load the default
if (!restored) { if (!restored) {
await this.initDefaultWorkflow(defs); await this.initDefaultWorkflow("defaultWorkflow", defs);
await this.initDefaultWorkflow("upscale", defs);
} }
// Save current workflow automatically // Save current workflow automatically
@@ -704,15 +705,15 @@ export default class ComfyApp {
selectionState.clear(); selectionState.clear();
} }
async initDefaultWorkflow(defs?: Record<string, ComfyNodeDef>) { async initDefaultWorkflow(name: string = "defaultWorkflow", defs?: Record<string, ComfyNodeDef>) {
let state = null; let state = null;
try { try {
const graphResponse = await fetch("/workflows/defaultWorkflow.json"); const graphResponse = await fetch(`/workflows/${name}.json`);
state = await graphResponse.json() as SerializedAppState; state = await graphResponse.json() as SerializedAppState;
} }
catch (error) { catch (error) {
console.error("Failed to load default graph", error) console.error(`Failed to load default graph ${name}`, error)
notify(`Failed to load default graph: ${error} `, { type: "error" }) notify(`Failed to load default graph ${name}: ${error} `, { type: "error" })
state = structuredClone(blankGraph) state = structuredClone(blankGraph)
} }
await this.openWorkflow(state, defs) await this.openWorkflow(state, defs)