Basic graph template saving
This commit is contained in:
@@ -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" });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user