Sublist To Image Batch (mtb)
Turn a nested list back into a real image batch
- tensors
- IMAGE
Some ComfyUI iteration patterns - loops, sub-workflows that run per item, frame-by-frame processing - hand you back a list of lists instead of one clean batch: a "sublist" where each entry is its own separate item rather than one unified tensor. A lot of nodes downstream (grid savers, batch-only processors) expect a real batched IMAGE tensor and choke on that nested shape. This node flattens the nested structure back into one proper batch.
What it does
One input, tensors (typed IMAGE, despite the "sublist" framing in the name - it's built to accept the nested list-of-images shape that loop/iteration constructs tend to produce), one output, IMAGE - a real stacked batch tensor. No parameters to tune; it's a structural fix, not a processing step.
Where it fits
This is the natural companion to mtb's iteration nodes - something like Read Playlist stepping through entries one at a time, each pass appending a result to a growing sublist. By the time the loop's done, you've got a list of individual images rather than a batch, and Save Image Grid (or any other batch-expecting node) won't accept that directly. Sublist To Image Batch is the join step: collect everything the loop produced, hand it a proper batch, and continue the workflow as if you'd generated the whole batch in one shot.
Worth noting: this node's category in the pack's own menu is batch_processing rather than the mtb/... prefix the rest of the pack uses - a small tell that it's a newer addition, likely from the pack's in-progress dev/0.6.0 branch that the README itself flags as where active work is happening, ahead of main.
When you'd use it
Anywhere you've built a loop-based pipeline (video frame processing, a batch runner assembled from playlist/index nodes, a sub-workflow that runs once per item) and you need the output to behave like a normal batch again for anything downstream that doesn't know or care that it was built one item at a time.
Installing it
ComfyUI Manager: search "MTB Nodes," install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/melMass/comfy_mtb
restart, and if this node specifically doesn't appear, keep in mind it may only ship on the pack's dev/0.6.0 branch rather than main - check which branch Manager pulled, or clone dev/0.6.0 directly if you need it and it's missing from a main install. Beyond that, the standard fix for missing nodes after a Manager install is cd-ing into comfy_mtb and running pip install -r requirements.txt by hand.
Common issues
Because this is a structural/shape-fixing node, the main failure mode isn't the node itself but a mismatch upstream - if what you're feeding it isn't actually the nested-list shape it expects (say, it's already a normal batch), you may not see an error so much as a no-op, or an output that's technically valid but not the fix you were expecting. If in doubt, check the shape of what you're feeding in before adding this node - it solves one specific structural problem, not batching in general.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| tensors | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |