CV Canvas Compose Batch
The unglamorous padding node that makes batches stack
- images
- images
- count
The name oversells it. CV Canvas Compose Batch (WASCanvasComposeBatch) doesn't compose anything in the collage sense - it takes up to two image batches and merges them into one batch where every image has been padded with transparency up to the largest dimensions. That's the whole job, and it's a genuinely useful job, because ComfyUI's tensor operations choke when you torch.stack images of different sizes. This node makes mismatched batches stackable, which is why it ships alongside the Content Viewer's Canvas compositor.
How it works
From the source, it's ~30 lines. Both images_a and images_b get flattened into one list of individual frames (it handles 4D batches and single 3D images alike), then it finds the max width and height across everything. Each image gets pasted dead-center onto a transparent 4-channel canvas of that max size - alpha 1.0 where the image sits, 0 elsewhere - and the result is stacked into a single IMAGE tensor. Think of it as "normalize to a shared canvas" rather than "compose." The padding strategy (center, transparent margins) is the same thing the Content Viewer's Canvas view uses to layer images, so the two are siblings in spirit: this one does the boring batch math, that one gives you the interactive workspace.
One quirk worth knowing before it surprises you: if both inputs are empty, it doesn't error - it returns a 1×64×64×4 transparent dummy. That's a "graceful nothing," not a bug, but it means you can silently pipe a blank image downstream if you forget to connect anything. Double-check your inputs.
The inputs and output
Only three fields, all optional:
images_a(IMAGE) - first batchimages_b(IMAGE) - second batchimages(IMAGE) - the output: one padded batch of everything, all frames at the same size
That's the list. No sizes to set, no alignment modes, no fancy options. It's a utility, and it's refreshingly free of knobs.
When you'd reach for it
Two honest use cases. First, prep batches for the Content Viewer's Canvas compositor or any downstream node that requires uniform shapes (batch image processing, contact sheets, saving grids) when your images come from different sources at different resolutions. Second, as a general "make these two batches one batch" tool. It comes from the WASasquatch/ComfyUI_Viewer pack, so install is the same as the Content Viewer: git clone https://github.com/WASasquatch/ComfyUI_Viewer.git into ComfyUI/custom_nodes, restart, and it appears in the WAS/View category. No extra dependencies - the pack's requirements.txt is explicit that nothing beyond ComfyUI itself is needed. It won't win you likes on a workflow share, but when torch starts yelling about shape mismatches, it's the quiet fix.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| images | COMFY_AUTOGROW_V3 | The batches to join, in slot order. The list grows as slots are filled, up to 26. Slots do not have to match each other in size or in count, and an unconnected slot contributes nothing. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | Every image from every slot, each centred on a transparent canvas as wide and as tall as the largest one. With no slot fed, a single transparent 64x64 image. |
| count | INT | How many frames the batch holds, which is the total across the slots rather than the number of slots. |