Nodes/MTB Nodes/Get Batch From History (mtb)
ComfyUI Node Runs on cloud

Get Batch From History (mtb)

Feeding a queue's own output back into itself

By melMass·Created 3 years ago·Updated about a month ago· 721
Get Batch From History (mtb)
  • passthrough_image
  • images
enabletrue
count1
offset0
internal_count0

This is mtb's own "experimental" label, and it's earned: the node reaches into ComfyUI's history endpoint - the same store that backs the image gallery in the UI - and pulls back outputs from previous queue runs. Every core output node (Save Image, Preview Image, and friends) populates that history as you queue prompts. Most of the time you never think about it. This node reads it back into your graph, which sounds mundane until you realize what it unlocks: feedback. You can build a workflow where the next queue run consumes the previous run's output as an input, chained automatically across many queued runs - the classic "poor man's" feedback-diffusion trick, where a small effect (a blur, a sharpen) compounds frame over frame into something that looks a lot more elaborate than the sum of its parts.

The author's own advice, worth repeating: start simple, with workflows that produce exactly one output per queue run. Multiple outputs work too - order is preserved as long as everything actually ran - but that's advanced-mode, not where you start.

How the feedback pattern actually works

In the pack's own example workflow, a node feeds frame == 0 through Int To Bool (mtb) to drive this node's enable input: on the very first queued run, enable is false and the node passes through the passthrough_image (an initial seed image) instead of pulling anything from history - because on frame zero, there's no history yet. On every subsequent run, enable flips true and the node fetches what the previous run produced, runs it through a light effect (blur, then sharpen, in the reference example), and that becomes the frame that gets saved and the frame the next run will read back. Loop that across dozens of queued runs (mtb's own Animation Builder node is what typically drives the repeated queuing) and you get an evolving sequence out of almost nothing - a cheap analogue to the classic Gray-Scott "creative" reaction-diffusion effect, built from a blur and a sharpen instead of an actual diffusion simulation.

Inputs and outputs that matter

  • enable (default true) - when false, the node skips history entirely and passes through passthrough_image instead. This is what you gate on "is there history yet."
  • count (default 1) - how many frames to pull from history.
  • offset (default 0) - shifts which point in history you're reading from, relative to the most recent entries.
  • passthrough_image (optional) - the image used when enable is false. Essential for seeding the very first frame of a feedback loop before any history exists.
  • internal_count - bookkeeping the node manages itself between runs; not something you'd typically hand-set.

Output is a single images batch. The node's own UI also has a Reset button (clears its internal counters) and a Queue button (a convenience for running total_frames × loop_count queues in one click) - those live on the node itself, not as graph inputs.

Installing it

  • ComfyUI Manager - search "MTB Nodes", install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/melMass/comfy_mtb, restart. A manual clone needs pip install -r requirements.txt run inside the comfy_mtb folder first.

No models needed - it's reading ComfyUI's own history, not calling out anywhere.

Common issues & troubleshooting

First run errors or returns nothing. History is empty before you've queued anything. That's exactly what enable + passthrough_image are for - gate the first run to skip history and use a seed image instead, as in the pack's own example.

Feedback loop doesn't look "alive," just static. Check count and offset against how many frames you're actually queuing, and confirm your effect nodes between the fetch and the save are strong enough to compound - a very subtle per-frame change can take many iterations before it's visually obvious.

The node itself, or others in the pack, fail to load. Marked "experimental" for a reason - this is one of the pack's less battle-tested corners. Check the startup console for [comfy_mtb] STATUS and http://127.0.0.1:8188/mtb if it doesn't show up in the node list at all.

Categorymtb/animation

Inputs (5)

NameTypeDefaultDescription
enableBOOLEANtrue
countINT1
offsetINT0-1000000000–1000000000
internal_countINT0
passthrough_imageoptIMAGE

Outputs (1)

NameTypeDescription
imagesIMAGE