Nodes/Color Gel Pixel/Color Gel Batch Flatten
ComfyUI Node

Color Gel Batch Flatten

Glue up to ten image batches into one, so a single save writes them all

By cadric·Created 11 months ago·Updated 11 months ago· 0
Color Gel Batch Flatten
  • images_1
  • images_2
  • images_3
  • images_4
  • images_5
  • images_6
  • images_7
  • images_8
  • images_9
  • images_10
  • images

If you've already got two or three image batches sitting in your graph and you just want them in one tensor, this is the glue node. Color Gel Batch Flatten takes up to ten IMAGE batches and concatenates them along the batch axis into a single output. It's the "and now treat all of this as one thing" step - usually so a single Color Gel Save writes everything with identical settings, or so one downstream node sees the whole set at once.

It earns its name: "flatten" means it smashes the batches together, not that it flattens pixels. Where Color Gel Batch (N) stacks up to ten single images into a batch, this one takes batches already made and merges them. Think of the pair as "make batches" and "merge batches." In the Color Gel Pixel example workflow you mostly don't need it - two images go straight into Batch (N). You reach for Flatten when you've got several branches each producing a batch - a few tinted variants, a couple of preview crops - and you want them downstream as one list of frames.

How it works

Every input (images_1 through images_10) is optional, but at least one has to be connected or it throws. Under the hood it does three things per input, in this order:

  • Ensures each input is a proper batch (a lone HxWxC image gets an extra dimension),
  • Checks every batch shares the same height and width,
  • Converts everything to RGBA so alpha channels line up.

Then it's a straight torch.cat on the batch axis. If you feed it two batches of 3 frames each, you get one batch of 6. The output is always 4-channel because of that RGBA unification - worth knowing if you're comparing channels downstream and something unexpectedly has an alpha plane.

The inputs that matter

Honestly, this node has no knobs. Ten optional IMAGE inputs, one images output. You just wire what you have and leave the rest unconnected. The one thing that bites people: all connected batches must share width and height, and it will error loudly if they don't. If your branches produced different resolutions, fix that before this node, not after.

Installing Color Gel Pixel

Color Gel Batch Flatten is part of the Color Gel Pixel pack (MIT, by cadric). Install it once and you get all seven nodes - this is just one of them.

cd ComfyUI/custom_nodes
git clone https://github.com/cadric/color_gel_pixel

Then restart ComfyUI. Or skip the terminal: ComfyUI Manager → Install Custom Nodes → search "Color Gel Pixel." Either path lands you in the same place, and the pack needs nothing extra - no model downloads, no pip installs. Its pyproject.toml lists zero dependencies because it leans on torch, NumPy, and Pillow, which ComfyUI already ships. It does want ComfyUI 0.3.65 or newer.

Common issues

  • "all batches must share width/height" - the one error you'll actually see. Downscale or crop the odd batch out before flattening.
  • Surprise alpha. Output is always RGBA. If a downstream node expects 3 channels, that's this node doing its job, not a bug.
  • Palettes not updating. This pack preloads palettes at import time, so after you edit a palette JSON you need Reload Custom Nodes before the dropdowns notice. Doesn't affect this node directly, but it's the pack's most common "why didn't it change" gotcha.

It's a quiet, no-frills utility - and that's the right scope. There's no community drama around Color Gel Pixel because it's a small, freshly packaged pack solving one workflow: color-gel tinting plus pixel-friendly saving. For the batch-merging piece of that, Flatten is the terminal node you won't think about again after you wire it.

CategoryColor Gel Pixel/Batch

Inputs (10)

NameTypeDefaultDescription
images_1optIMAGEOptional batch 1 (B x H x W x C).
images_2optIMAGEOptional batch 2 (B x H x W x C).
images_3optIMAGEOptional batch 3 (B x H x W x C).
images_4optIMAGEOptional batch 4 (B x H x W x C).
images_5optIMAGEOptional batch 5 (B x H x W x C).
images_6optIMAGEOptional batch 6 (B x H x W x C).
images_7optIMAGEOptional batch 7 (B x H x W x C).
images_8optIMAGEOptional batch 8 (B x H x W x C).
images_9optIMAGEOptional batch 9 (B x H x W x C).
images_10optIMAGEOptional batch 10 (B x H x W x C).

Outputs (1)

NameTypeDescription
imagesIMAGE