Nodes/ComfyUI_faishme/Faishme Stack Images
ComfyUI Node

Faishme Stack Images

Merge Several Image Sources Into Proper Batches — Without a Custom Script

By AkashKarnatak·Created 2 years ago·Updated about a year ago· 0
Faishme Stack Images
  • image
  • image
  • stack_size
stack_size1

Faishme Stack Images takes multiple separate image sources and merges them into batched tensors. If you've got six different nodes producing one image each and you want them combined into three batches of two, this is the node. The trick that makes it work is that it's list-aware: you connect several sources into its image input, it collects them as a list, then groups them by stack_size and concatenates each group along the batch dimension.

How it works

Under the hood the node is a chunk-and-cat: the incoming list of images is split into consecutive groups of stack_size, and each group is joined along the batch axis with torch.cat. Feed it six single images with stack_size 2 and you get three batched tensors out. Feed it three images with stack_size 1 and you get three single-image batches - technically valid, useless in practice, which tells you the knob only matters once stack_size > 1.

The list behavior is the part worth understanding. Because the node declares INPUT_IS_LIST, multiple upstream wires landing on the same input arrive as a list rather than colliding. That's the difference between this and a built-in batch concatenator: you can wire from genuinely different sources - a Load Image, a VAE decode, a masked crop - and have them collected in one place.

Inputs and outputs

  • image - accepts multiple image sources (list-aware).
  • stack_size - images per output batch, 1 to 16.

Outputs:

  • image - a list of batched IMAGE tensors, each holding up to stack_size images.
  • stack_size - the value you set, passed through so downstream nodes can read it.

It's flagged as an output node, so it can also terminate a branch.

Why you'd use it

Batch pipelines. A sampler processes a batch far more efficiently than it processes the same images one at a time, so gathering scattered single images into one batched tensor before the sampler is a genuine speed win. In the fashion workflow this pack is built for, that's the difference between generating a dozen model shots one-by-one and handing the sampler a real batch. It's also the natural companion to the pack's Unstack Images, which breaks batches back apart when you need per-image handling downstream.

Installing it

The standard pack install - ComfyUI Manager, search "ComfyUI_faishme", or:

cd ComfyUI/custom_nodes
git clone https://github.com/AkashKarnatak/ComfyUI_faishme

Restart ComfyUI. It lives under FaishmeNodes.

Where people get burned

The list semantics are the gotcha. If you wire a single source and expect it to stack frames from within that one batch, that's not how it works - it stacks sources, grouping the incoming list. And remember every group must have stack_size members for the math to line up; if your source count isn't divisible by stack_size, the last chunk is shorter and can bite. Count your sources, set stack_size accordingly, and it's a genuinely useful batch assembler.

CategoryFaishmeNodes

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
stack_sizeINT11–16

Outputs (2)

NameTypeDescription
imageIMAGE
stack_sizeINT