Workflow creation/modified state

This commit is contained in:
space-nuko
2023-05-20 22:20:36 -05:00
parent d12b4ac03e
commit ee97bd43bc
9 changed files with 179 additions and 48 deletions

View File

@@ -69,7 +69,12 @@ export class ComfyWorkflow {
/*
* Global workflow attributes
*/
attrs: WorkflowAttributes
attrs: WorkflowAttributes;
/*
* True if an unsaved modification has been detected on this workflow
*/
isModified: boolean = false;
get layout(): WritableLayoutStateStore | null {
return layoutStates.getLayout(this.id)
@@ -89,6 +94,11 @@ export class ComfyWorkflow {
this.graph = new ComfyGraph(this.id);
}
notifyModified() {
this.isModified = true;
store.set(get(store));
}
start(key: string, canvas: ComfyGraphCanvas) {
if (this.canvases[key] != null)
throw new Error(`This workflow is already being displayed on canvas ${key}`)