feat: support accumulate toggle for SaveImage/PreviewImage nodes

Read the accumulate widget value in the executed event handler and pass
merge: true to the output store, so outputs accumulate across runs.

Amp-Thread-ID: https://ampcode.com/threads/T-019c98ab-5e7d-72fe-84d2-20e551f5ac10
This commit is contained in:
bymyself
2026-02-25 22:56:56 -08:00
parent ea5ffcc66e
commit fab04e6c2c

View File

@@ -717,11 +717,15 @@ export class ComfyApp {
const nodeOutputStore = useNodeOutputStore()
const executionId = String(detail.display_node || detail.node)
const node = getNodeByExecutionId(this.rootGraph, executionId)
const accumulate = node?.widgets?.find(
(w) => w.name === 'accumulate'
)?.value
nodeOutputStore.setNodeOutputsByExecutionId(executionId, detail.output, {
merge: detail.merge
merge: detail.merge || !!accumulate
})
const node = getNodeByExecutionId(this.rootGraph, executionId)
if (node && node.onExecuted) {
node.onExecuted(detail.output)
}