ZML_列表转批次
The ZML node that folds a pile of loose wires into one image batch
- 图像列表
- 图像批次
- 合并文本
ComfyUI is quietly terrible at "I have several separate images on the canvas and I want them treated as one batch." Most nodes output a batch; almost nothing lets you build one from loose ends. ZML_列表转批次 - ZML_List_To_Batch - is the little collector that does, and it's one of the ZML pack's genuinely handy plumbing nodes rather than a gimmick.
It takes two kinds of "list" input and collapses them: an optional 图像列表 (image list) and an optional 文本列表 (text list). Internally it just concatenates the image tensors along the batch dimension with torch.cat, and joins the text strings with the 分隔符 (separator, default ,\n). Out the other side you get one 图像批次 (IMAGE) and one 合并文本 (STRING). Wire the batch into whatever sampler or loader chain you'd normally feed with a single load - that's the whole trick.
When does this actually save you? The ZML author's own README notes ComfyUI started handling lists natively around late 2025, and this node exists to bridge between that world and the batch world. Two real setups: you have several ZML_LoadImage nodes each producing a single image and you want to run them through one process node; or you've got a text node per prompt and you want them joined into one string for a save or a batch of generations. The 分隔符 matters more than it looks - ,\n gives you comma-newline, which is what a prompt list wants, and it interprets the literal \n escape so you can type it without actually hitting Enter.
The gotcha is the one that bites everyone: images of different resolutions get silently dropped from the batch. The node only concatenates tensors with matching H×W, so a 512×512 and a 1024×1024 mixed together means one of them vanishes with no error. Feed it a uniform folder, or normalize first. And if nothing valid arrives at all, it returns a 1×1 black placeholder - which downstream nodes happily swallow, so the failure looks like "everything's black" rather than "nothing loaded."
Install it the same way you install the rest of the pack (see below), and it'll sit under the ZML 图像 category in the menu. Nothing to download beyond the pack itself - this is pure tensor plumbing, no models, no API calls.
cd ComfyUI/custom_nodes
git clone https://github.com/zml-w/ComfyUI-ZML-Image
Restart ComfyUI. If you're using ComfyUI Manager, search "ComfyUI-ZML-Image" and install from there instead - the pack's requirements.txt pulls numpy, torch, Pillow, opencv-python and friends, and Manager handles those for you. The UI is in Chinese, so if that's not your language grab the English translation patch the author links at the top of the README.
One more note: this is a "do the thing you'd hand-wire anyway" node, so it's only worth installing if you're already in the ZML ecosystem. But if you are - and especially if you use ZML's load-from-path nodes that output real lists - you'll reach for it constantly.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| 分隔符 | STRING | ,\n | — |
| 图像列表opt | IMAGE | — | |
| 文本列表opt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| 图像批次 | IMAGE | — |
| 合并文本 | STRING | — |