Nodes/ComfyUI-BrainDead/BD Atlas Pack
ComfyUI Node

BD Atlas Pack

Pack multiple images into one grid atlas (rows x columns) with padding. Sources are concatenated in order: the `images` batch, then image_1..image_8, then `masks` (batch) supplies each cell's alpha (falls back to an RGBA image's own alpha, else opaque). Each image is fit into a uniform cell via contain / cover / stretch. Outputs the atlas image, a single-channel mask atlas, and a JSON layout string with per-cell pixel + normalised-UV rects for game engines.

By BizaNator·Created 7 months ago·Updated 16 days ago· 14
BD Atlas Pack
  • images
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • masks
  • atlas
  • mask
  • layout
columns0
rows0
cell_width0
cell_height0
fit_modecontain
padding0
background_hex#000000
orderrow_major
output_alphafalse
Category🧠BrainDead/Segmentation

Inputs (19)

NameTypeDefaultDescription
imagesoptIMAGEBatched IMAGE (B,H,W,C) — each frame becomes one cell, in batch order.
image_1optIMAGEIndividual image for a cell (appended after the batch).
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE
image_6optIMAGE
image_7optIMAGE
image_8optIMAGE
masksoptMASKBatched MASK — mask[i] is the alpha for cell i (aligned to the concatenated image order). If absent, an RGBA image's own alpha is used, else opaque.
columnsoptINT00–64Number of columns. 0 = auto (≈ square: ceil(sqrt(count))).
rowsoptINT00–64Number of rows. 0 = auto (ceil(count / columns)). Expanded if too small to fit all cells.
cell_widthoptINT00–8192Pixel width of each cell. 0 = use the widest input image.
cell_heightoptINT00–8192Pixel height of each cell. 0 = use the tallest input image.
fit_modeoptCOMBOcontaincontain — fit whole image in cell, pad with background (no crop). cover — fill cell, center-crop overflow. stretch — resize to cell, ignore aspect.
paddingoptINT00–512Pixels of background between cells AND around the outer border.
background_hexoptSTRING#000000Background / padding fill colour (hex). Mask atlas pad regions are always 0.
orderoptCOMBOrow_majorrow_major — fill left-to-right then down. column_major — fill top-to-bottom then right.
output_alphaoptBOOLEANfalseIf True, the atlas IMAGE is RGBA (alpha = the mask atlas). Default is RGB.

Outputs (3)

NameTypeDescription
atlasIMAGE
maskMASK
layoutSTRING