Basic graph template saving

This commit is contained in:
space-nuko
2023-05-23 23:15:49 -05:00
parent 47b0dabd80
commit 8a97ab349a
9 changed files with 461 additions and 12 deletions

View File

@@ -32,10 +32,7 @@ export class ComfyBackendNode extends ComfyGraphNode {
this.setup(nodeDef)
// ComfyUI has no obvious way to identify if a node will return outputs back to the frontend based on its properties.
// It just returns a hash like { "ui": { "images": results } } internally.
// So this will need to be hardcoded for now.
if (["PreviewImage", "SaveImage"].indexOf(comfyClass) !== -1) {
if (nodeDef.output_node) {
this.addOutput("OUTPUT", BuiltInSlotType.EVENT, { color_off: "rebeccapurple", color_on: "rebeccapurple" });
}
}

View File

@@ -8,7 +8,7 @@ import type IComfyInputSlot from "$lib/IComfyInputSlot";
import uiState from "$lib/stores/uiState";
import { get } from "svelte/store";
import configState from "$lib/stores/configState";
import type { WritableLayoutStateStore } from "$lib/stores/layoutStates";
import type { WidgetLayout, WritableLayoutStateStore } from "$lib/stores/layoutStates";
import layoutStates from "$lib/stores/layoutStates";
import workflowStateStore, { ComfyWorkflow } from "$lib/stores/workflowState";
@@ -107,6 +107,10 @@ export default class ComfyGraphNode extends LGraphNode {
return layoutStates.getLayoutByNode(this);
}
get dragItem(): WidgetLayout | null {
return layoutStates.getDragItemByNode(this);
}
get workflow(): ComfyWorkflow | null {
return workflowStateStore.getWorkflowByNode(this);
}