Tile Packing (Latent)
Keep the atlas latent too
- tiles
- tileset
- vae
- LATENT
Every tile node in this pack has an image and a latent form, and the latent ones exist so you can run a whole tile pipeline without bouncing through the VAE between stages. Latent Tile Packing is that discipline applied to the atlas: it takes your latent tile set and packs it into a single latent "sheet" - the same grid layout the image-space TilePacking produces, but in latent space, decoded exactly once at the end.
What it does
It calls the same pack_tiles layout routine on latent tensors, so the output is the full tile library arranged in a compact colors² × colors² grid - 9×9 at the default 3 colors - one latent image that documents every variant. Decode it and you've got the atlas you'd save or share; keep it latent and you can feed it into LatentRandomTiling or a further sampling stage without an encode round trip. The VAE input is only there to know the downscale ratio (latent resolution = resolution // vae.downscale_ratio), not to do any work - matching the pattern of the other latent nodes in the pack.
Inputs and outputs
- tiles (LATENT) - your latent tile set
- tileset (TILESET, forceInput) - kind, colors, resolution, candidates; must come from an upstream node
- vae (VAE) - used for the latent downscale factor
Output is a single LATENT. VAEDecode it once to get the atlas image.
Installing and notes
Standard pack install: git clone https://github.com/samsartor/content_aware_tiles into ComfyUI/custom_nodes (or ComfyUI Manager → "content_aware_tiles") and restart. No model downloads.
The same constraint as the image version applies: a dual tileset must contain the full colors**4 * 2 interior + cross tiles or the node raises a ValueError with the expected count. And one latent-space subtlety worth knowing: because the whole set lives in one latent, decoding it is a single big memory event - if you're on a tight VRAM card, decode at a smaller packed size or run the decode through the pack's SubBatchVAE to chunk it. This is research code with effectively no community presence, so when in doubt, read the ~20-line node and the workflow JSON rather than searching for forum help.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| tiles | LATENT | — | |
| tileset | TILESET | — | |
| vae | VAE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |