🎈LG_AccumulatePreview
A preview that grows as your workflow runs, pass after pass
- images
- mask
- images
- masks
- image_count
Most preview nodes show you this run's output and forget it. LG_AccumulatePreview remembers. It piles every image that passes through it across multiple executions into one growing preview, and - the part that makes it more than a gallery - it outputs that whole accumulated list plus a count. So it doubles as an in-graph accumulator: run your workflow in a loop, feed each pass's result here, and at the end you have the complete sequence as a list of IMAGEs and MASKs, not just a screenshot of the last pass.
It's one of the more clever nodes in Comfyui-LG_GroupExecutor, LAOGOU-666's small utility pack. No dependencies, no models; the accumulation is plain in-memory state on the node instance, which is both its power and its catch.
How it works
Each execution appends the incoming images to the node's internal accumulated_images list, writing each to a temp PNG so the UI can show it, and tracks an internal counter for filenames. If you wire in the optional mask, each image's mask is accumulated alongside it (aligned per image); masks without a matching mask slot just come back as the accumulated ones.
When the node runs, it returns three outputs:
- images - the full accumulated IMAGE list so far.
- masks - the accumulated MASK list (only the ones you actually provided).
- image_count - an INT,
len(accumulated_images).
Because the state lives on the node instance, a re-run of the graph continues accumulating rather than starting over. That's the loop-collection workflow: run, run, run, and the last pass hands you everything.
Inputs
- images (IMAGE) - the current pass's frames.
- mask (optional MASK) - per-image mask to accumulate alongside.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/LAOGOU-666/Comfyui-LG_GroupExecutor
or ComfyUI Manager → "Comfyui-LG_GroupExecutor", then restart.
Gotchas
- State is sticky by design. The counter and list survive between executions until ComfyUI reloads or the node is rebuilt. If a fresh run should start clean, reload the workflow or restart the server.
- Everything lands in temp. Accumulated previews are written to the temp directory - fine for review, not for archival.
- Masks only accumulate when you provide them, and the output mask list reflects only images that had one, so index alignment between the two output lists isn't guaranteed when masks are intermittent.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| maskopt | MASK | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| masks | MASK | — |
| image_count | INT | — |