Workflow saving/loading

This commit is contained in:
space-nuko
2023-05-06 21:39:21 -05:00
parent 2a2d04803b
commit da65d1b439
6 changed files with 78 additions and 18 deletions

View File

@@ -33,7 +33,8 @@ export default class ComfyValueControl extends ComfyGraphNode {
{ name: "step", type: "number" }
],
outputs: [
{ name: "value", type: "*" }
{ name: "value", type: "*" },
{ name: "changed", type: BuiltInSlotType.EVENT }
],
}
@@ -93,6 +94,7 @@ export default class ComfyValueControl extends ComfyGraphNode {
v = clamp(v, min, max)
this.setProperty("value", v)
this.triggerSlot(1, v)
this.setOutputData(0, v)
console.debug("ValueControl", v, this.properties)

View File

@@ -101,7 +101,7 @@ export abstract class ComfyWidgetNode<T = any> extends ComfyGraphNode {
if (this.changedIndex !== null && this.outputs.length >= this.changedIndex) {
const changedOutput = this.outputs[this.changedIndex]
if (changedOutput.type === BuiltInSlotType.EVENT)
this.triggerSlot(this.changedIndex, "changed")
this.triggerSlot(this.changedIndex, get(this.value))
}
}