D2 Image Stack
A batch builder with a dial for how many images you want
- images
D2 Image Stack is the "make one batch out of several images" node, and its one trick is a dial: set image_count and it grows (or shrinks) its input sockets to match. Want to merge three variations into one batch for a single save, grid, or batch-process pass? Set it to 3, wire image_1..image_3, done. Got ten? Dial it to 10. It handles up to 50 inputs, which covers about any realistic comparison or contact-sheet build.
It's a deliberate sibling of D2 Image Mask Stack (that one pairs images with masks); this one is just the image side. Where it slots into a workflow: collecting multiple generations before a D2 Grid Image, batching several crops into one inpaint pass, or stacking variants before a single save node so you get one file instead of a row of them.
The inputs
image_count- 1 to 50, default 3. Controls how manyimage_Ninput sockets exist.
That's the whole fixed input surface; the dynamic image_1..image_N sockets are the real inputs.
Output
images - all connected images concatenated into a single IMAGE batch.
The node normalizes channel counts across inputs (RGB vs RGBA) so a mixed batch doesn't crash - same tolerance as Image Mask Stack.
Installing it
It's in the D2 pack. ComfyUI Manager → search "D2-nodes-ComfyUI" → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/da2el-ai/D2-nodes-ComfyUI
Restart. No model downloads; the pack's only deps are piexif and charset-normalizer. Since v32.0.0 it targets ComfyUI's V3 schema - older ComfyUI builds should pin the pack before 32.0.0.
The honest caveats
Two things to keep in mind. First, torch.cat needs all images at the same resolution - this node batches them without resizing, so mismatched sizes will error downstream (or here). Get sizes aligned first. Second, unconnected sockets are simply skipped, so a gap in your wiring silently produces a shorter batch; if the count comes out short, check that you didn't leave slot 2 empty. Otherwise it's a boring, dependable utility - which is exactly what you want from a batch builder.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image_count | INT | 31–50 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |