Nodes/Dustin ComfyUI Nodes/Dustin Image Atlas
ComfyUI Node

Dustin Image Atlas

Pack a batch of images onto one canvas without resizing a pixel

By zihualiu1997·Created 4 months ago·Updated 4 months ago· 1
Dustin Image Atlas
  • images
  • atlas_image
  • atlas_metadata
max_width1024
max_height1024
padding0

Dustin Image Atlas takes a batch of images and stiches them onto one big canvas - a texture atlas, the same packing trick games have used since forever. You feed it an IMAGE batch, it lays the tiles out left to right, wraps to a new row when it hits your width limit, and hands you one combined image plus a JSON map of where everything landed. Think of it as the "unbatch" node: instead of dragging a dozen images around separately, you get one image and a coordinate file that tells you where each original went.

Why bother

Two real reasons. First, some nodes downstream prefer a single image over a batch - an atlas is how you hand many images to something that wants one. Second, and more interesting, the metadata output makes this a bookkeeping node: atlas_metadata is JSON with each tile's index, x, y, width and height, plus the final canvas size. That's the round-trip contract that lets Dustin Image Atlas Extract pull a tile back out by number. If that extractor didn't exist, this node would be a one-way trip.

The inputs that matter

  • max_width / max_height (both default 1024) - the bounds of the atlas canvas.
  • padding (default 0) - empty pixels between tiles, if you need breathing room or want to avoid bleed in whatever consumes the atlas.
  • images - the batch. This is where the sharp edge is.

The layout is deterministic and simple, straight from the source: tiles go left to right, and when the next tile would overflow max_width it wraps to a new row. It never resizes and it never drops an image. If a tile is bigger than the limits, or the whole batch doesn't fit inside max_height, the node raises an error instead of quietly scaling things down. That's a design decision worth respecting - an atlas that silently resized tiles would lie to you about coordinates. If you hit the error, either raise the limits or resize your inputs before the atlas node, not after.

One more constraint from the code: every image in the batch must be square. A 512×768 tile throws "not square" before anything is stitched. If you're feeding it arbitrary crops, normalize them first.

Wiring it

atlas_image (IMAGE) is the stitched result; atlas_metadata (STRING) is the JSON you should keep paired with it. The obvious downstream is the Extract node, but nothing stops you from saving the atlas directly or pushing it into any single-image consumer. If you lose the metadata, the atlas is just a pretty mosaic - the whole system depends on keeping those two outputs together.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/zihualiu1997/dustin-comfyui-nodes

Restart ComfyUI, then search "Dustin" in the node menu. You can also install "dustin-comfyui-nodes" straight from ComfyUI Manager. This node is pure Python standard library - torch is already in ComfyUI, and there's nothing else to install and no model to download. It's honest plumbing, and it does its one job without surprises, which is more than most starter-pack utilities can claim.

CategoryDustin Nodes/Image

Inputs (4)

NameTypeDefaultDescription
imagesIMAGE
max_widthINT10241–16384
max_heightINT10241–16384
paddingINT00–512

Outputs (2)

NameTypeDescription
atlas_imageIMAGE
atlas_metadataSTRING