Prompt serializer and test fixes
This commit is contained in:
@@ -29,13 +29,10 @@ export default class ComfyConfigureQueuePromptButton extends ComfyGraphNode {
|
||||
throw new Error(`Could not find layout attached to this node! ${this.id}`)
|
||||
}
|
||||
|
||||
this.layoutState.update(state => {
|
||||
if (typeof param === "string")
|
||||
state.attrs.queuePromptButtonName = param || ""
|
||||
else if (typeof param === "object" && "buttonName" in param)
|
||||
state.attrs.queuePromptButtonName = param.buttonName || ""
|
||||
return state
|
||||
})
|
||||
if (typeof param === "string")
|
||||
this.workflow.attrs.queuePromptButtonName = param || ""
|
||||
else if (typeof param === "object" && "buttonName" in param)
|
||||
this.workflow.attrs.queuePromptButtonName = param.buttonName || ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import { get } from "svelte/store";
|
||||
import configState from "$lib/stores/configState";
|
||||
import type { WritableLayoutStateStore } from "$lib/stores/layoutStates";
|
||||
import layoutStates from "$lib/stores/layoutStates";
|
||||
import workflowStateStore, { ComfyWorkflow } from "$lib/stores/workflowState";
|
||||
|
||||
export type DefaultWidgetSpec = {
|
||||
defaultWidgetNode: new (name?: string) => ComfyWidgetNode,
|
||||
@@ -106,6 +107,10 @@ export default class ComfyGraphNode extends LGraphNode {
|
||||
return layoutStates.getLayoutByNode(this);
|
||||
}
|
||||
|
||||
get workflow(): ComfyWorkflow | null {
|
||||
return workflowStateStore.getWorkflowByNode(this);
|
||||
}
|
||||
|
||||
constructor(title?: string) {
|
||||
super(title)
|
||||
this.addProperty("tags", [], "array")
|
||||
|
||||
Reference in New Issue
Block a user