mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-12 22:42:36 +08:00
allow multiple images
This commit is contained in:
parent
fbbaca00eb
commit
0764885874
@ -319,7 +319,10 @@ const ext = {
|
|||||||
if (!node) {
|
if (!node) {
|
||||||
const split = detail.split(":");
|
const split = detail.split(":");
|
||||||
if (split.length === 2) {
|
if (split.length === 2) {
|
||||||
api.dispatchEvent(new CustomEvent("executing", { detail: split[0] }));
|
const outerNode = app.graph.getNodeById(+split[0]);
|
||||||
|
if (outerNode?.constructor.nodeData?.[IS_GROUP_NODE]) {
|
||||||
|
api.dispatchEvent(new CustomEvent("executing", { detail: split[0] }));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -330,7 +333,11 @@ const ext = {
|
|||||||
if (!node) {
|
if (!node) {
|
||||||
const split = detail.node.split(":");
|
const split = detail.node.split(":");
|
||||||
if (split.length === 2) {
|
if (split.length === 2) {
|
||||||
api.dispatchEvent(new CustomEvent("executed", { detail: { ...detail, node: split[0] } }));
|
const outerNode = app.graph.getNodeById(+split[0]);
|
||||||
|
if(outerNode?.constructor.nodeData?.[IS_GROUP_NODE]) {
|
||||||
|
api.dispatchEvent(new CustomEvent("executed", { detail: { ...detail, node: split[0], merge: !outerNode.resetExecution } }));
|
||||||
|
outerNode.resetExecution = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -353,6 +360,12 @@ const ext = {
|
|||||||
const config = def[GROUP_DATA];
|
const config = def[GROUP_DATA];
|
||||||
const slots = def[GROUP_SLOTS];
|
const slots = def[GROUP_SLOTS];
|
||||||
|
|
||||||
|
const onExecutionStart = node.onExecutionStart;
|
||||||
|
node.onExecutionStart = function() {
|
||||||
|
node.resetExecution = true;
|
||||||
|
return onExecutionStart?.apply(this, arguments);
|
||||||
|
}
|
||||||
|
|
||||||
const onNodeCreated = node.onNodeCreated;
|
const onNodeCreated = node.onNodeCreated;
|
||||||
node.onNodeCreated = function () {
|
node.onNodeCreated = function () {
|
||||||
for (let innerNodeId = 0; innerNodeId < config.nodes.length; innerNodeId++) {
|
for (let innerNodeId = 0; innerNodeId < config.nodes.length; innerNodeId++) {
|
||||||
|
|||||||
@ -1135,7 +1135,19 @@ export class ComfyApp {
|
|||||||
});
|
});
|
||||||
|
|
||||||
api.addEventListener("executed", ({ detail }) => {
|
api.addEventListener("executed", ({ detail }) => {
|
||||||
this.nodeOutputs[detail.node] = detail.output;
|
const output = this.nodeOutputs[detail.node];
|
||||||
|
if (detail.merge && output) {
|
||||||
|
for (const k in detail.output ?? {}) {
|
||||||
|
const v = output[k];
|
||||||
|
if (v instanceof Array) {
|
||||||
|
output[k] = v.concat(detail.output[k]);
|
||||||
|
} else {
|
||||||
|
output[k] = detail.output[k];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.nodeOutputs[detail.node] = detail.output;
|
||||||
|
}
|
||||||
const node = this.graph.getNodeById(detail.node);
|
const node = this.graph.getNodeById(detail.node);
|
||||||
if (node) {
|
if (node) {
|
||||||
if (node.onExecuted)
|
if (node.onExecuted)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user