Image output fixes

This commit is contained in:
space-nuko
2023-05-05 07:13:38 -05:00
parent 267106bed4
commit ed28e0dfda
8 changed files with 100 additions and 18 deletions

View File

@@ -25,7 +25,7 @@ export class ComfyBackendNode extends ComfyGraphNode {
// 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) {
this.addOutput("output", "OUTPUT");
this.addOutput("output", "IMAGE");
}
}
@@ -78,12 +78,13 @@ export class ComfyBackendNode extends ComfyGraphNode {
console.warn("onExecuted outputs", outputData)
for (let index = 0; index < this.outputs.length; index++) {
const output = this.outputs[index]
if (output.type === "OUTPUT") {
if (output.type === "IMAGE") {
this.setOutputData(index, outputData)
for (const node of this.getOutputNodes(index)) {
console.warn(node)
if ("receiveOutput" in node) {
const widgetNode = node as ComfyWidgetNode;
widgetNode.receiveOutput();
const widgetNode = node as ComfyGraphNode;
widgetNode.receiveOutput(outputData);
}
}
}