Nodes/ComfyUI-ZML-Image/ZML_桥接预览图像
ComfyUI Node

ZML_桥接预览图像

The preview node that remembers your last ten runs

By zml-w·Created about a year ago·Updated 2 months ago· 218
ZML_桥接预览图像
  • 输入图像
  • 图像
关闭输入false
关闭输出false
选择输出索引0
暂存次数1

A normal preview node shows you the latest image and forgets it the moment the next run happens. ZML_ImageMemory (ZML_桥接预览图像, "bridge preview image") is the one that remembers - it holds your last several runs in a queue, shows them all in the node, and lets you flip back through them or output a specific one. If you've ever stared at one good result and thought "wait, which seed was the previous one?", this node is aimed at you.

It's from ComfyUI-ZML-Image, zml-w's 160+ node pack, and it's a deliberate riff on the bridge preview concept from the Impact Pack (the README credits it as inspiration). It lives in the pack's tools subcategory.

How it works

Every image that flows in gets cached per-node-instance and pushed onto a queue. The 暂存次数 (cache count) knob sets the queue length (1–10): set it to 3 and the node keeps the last three runs' images, displays them together, and can output any of them. Because the cache lives in the backend keyed to the node's unique ID, the images survive between runs - that's the whole trick, and it's why it's called "memory."

Three controls do the interesting work:

  • 选择输出索引 (output index) - 0 outputs everything cached (same-resolution images merge into one batch; different resolutions come out as a list). 1–50 picks a single image by index, counting each individual image - a batch of 5 counts as 5 separate indexed images. Out of range just returns the last one.
  • 关闭输入 (disable input) - stop executing the upstream nodes entirely, locking the node to its current cached state. This is lazy evaluation in practice: toggle it on and your sampler stops running while you compare what's already stored.
  • 关闭输出 (disable output) - let it receive new images but stop downstream nodes from executing.

The output is a 图像 list (the node is also an output/preview node, so the cached images render right in the node body).

What it's actually for

Comparing generations. Run three seeds, set 暂存次数 to 3, and instead of scrolling your output folder you flip through all three in the node. Use 关闭输入 to freeze the graph while you compare, then pick the winner by index and feed it onward. It slots naturally into the "review then decide" workflow the pack builds toward - the README describes it as the hub for pausing and choosing outputs.

Installing it

Same pack install as everything else:

cd ComfyUI/custom_nodes
git clone https://github.com/zml-w/ComfyUI-ZML-Image

restart, or install via ComfyUI Manager (search "ComfyUI-ZML-Image"). No extra models; the heavy requirements (OpenCV, scipy, ultralytics) belong to the pack's other nodes.

Where people get caught

The cache is keyed to the node instance in the workflow - duplicate the node and you get a separate cache, not a shared one. And if a run fails, the cached images from before are still there, which is great - until you forget they're stale and hand a downstream node an old image thinking it's fresh. The 关闭输入/关闭输出 toggles are your guardrails there. It's a review tool, so treat it as the thing that shows you what you made recently, not as the current truth of your pipeline.

Categoryimage/ZML_图像/工具

Inputs (5)

NameTypeDefaultDescription
关闭输入BOOLEANfalse开启后不执行上游节点,锁定当前状态
关闭输出BOOLEANfalse开启后不执行下游节点
选择输出索引INT00–500=输出缓存中的所有图像(同分辨率拼成batch,不同分辨率输出列表);1-50=按【单张图像】索引取出缓存中的第N张图。注意:索引按展开后的单图算——一次输入5张的批次会被展开成5张单图分别按索引取。超出范围时自动返回最后一张。
暂存次数INT11–10设置缓存队列的大小。例如设为3,节点会保留最近3次运行的图像(或3个批次),并将其合并输出。上限10次。
输入图像optIMAGE

Outputs (1)

NameTypeDescription
图像IMAGE