emit_cached_output at execution.py:818 doesn't pass merge flag for intermediate-output nodes

Open Beginner friendly
#16,307 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Read the two emit_cached_output call sites in execution.py, especially the end-of-loop cleanup path around line 818 and the direct cache-hit path around line 445. Done means the cleanup path derives and passes the merge flag the same way as the direct cache-hit path.

Written by the indexing model from the issue text.

Description

Follow-up from PR https://github.com/Comfy-Org/ComfyUI/pull/16304 (accumulate/merge flag on cached SaveImage/PreviewImage outputs), flagged by CodeRabbit review.

execution.py has two call sites for emit_cached_output:

  • Line 445 (per-node direct cache-hit path, fires for any node): correctly passes merge=merge derived from inputs.get('accumulate') is True.
  • Line 818 (end-of-loop cleanup pass, only for nodes with HAS_INTERMEDIATE_OUTPUT that weren't executed this run): does NOT pass merge.

Today this doesn't affect SaveImage/PreviewImage since neither sets HAS_INTERMEDIATE_OUTPUT, so #16304's fix is correct for its target case. But any node type that both sets HAS_INTERMEDIATE_OUTPUT and adopts an accumulate-style merge flag in the future would hit this same missing-flag bug via the 818 path instead.

Fix: derive and pass merge at line 818 the same way line 445 does.

Dominant language
Python
Stars
134k
Forks
15.9k
Avg merge
1d 2h
Merged PRs (30d)
161

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Comfy-Org/ComfyUI

All issues in Comfy-Org/ComfyUI

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.