ComfyUI Node

Generate Tile Mask

Get a per-tile coverage mask for latent-masked upscales

By Acly·Created 3 years ago·Updated about a month ago· 668
Generate Tile Mask
  • layout
  • mask
index0
blendfalse

The utility node of the tiling set. ETN_GenerateTileMask builds a coverage mask for a single tile - white where the tile's real image area is, black over the padding, with a smooth falloff between them. Merge Image Tile uses this internally to blend, but Acly exposed it as its own node for one specific reason: you can feed it into Set Latent Noise Mask in an upscale workflow, so a tile only gets re-diffused in its core area while its overlap stays untouched.

That's the trick that makes per-tile sampling clean. If you re-noise the full padded tile, the overlap regions get generated twice (once per neighbor) and disagree. Mask the noise to the tile's real area and the shared borders stay stable, which is half the battle in seam-free tiled upscaling - the other half being conditioning each tile on the source, per the upscaling KB.

How it works

Given the layout and a tile index, it produces a MASK sized to that tile: the image area is 1 (white), the padding area is 0 (black), and the transition between them is smoothed according to the blend size you set in the layout. It's the exact coverage map Merge Image Tile applies when compositing - so if you want to preview or reuse that blend, this is where it comes from.

The optional blend toggle controls whether you get that smooth transition or a harder-edged mask. For Set Latent Noise Mask you usually want the blended version so the denoise strength eases in rather than cutting sharply at the tile boundary.

The inputs and outputs that matter

  • layout (TileLayout) - the grid from ETN_TileLayout. Required.
  • index (INT, default 0, min 0) - which tile's mask to generate, column-major (same order as Extract/Merge).
  • blend (optional BOOLEAN, default false) - turn on the smooth transition in the padding zone. Enable it when the mask feeds noise masking or any blend-sensitive use; leave it off for a crisp coverage map.

Output:

  • mask (MASK) - the per-tile coverage mask. Common wiring: into Set Latent Noise Mask for that tile's sampling, so only the core area is denoised.

How to install it

Install the pack as a unit. ComfyUI Manager: search ComfyUI Nodes for External Tooling, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/Acly/comfyui-tooling-nodes.git

then restart. Nothing to download.

Common issues & troubleshooting

The mask is hard-edged when you wanted a feather. Flip the blend input to true. With it off you get a sharp image-area/padding boundary; noise masking usually wants the smooth version.

Wrong tile masked. Indices are column-major and must match the index you used to extract and merge that tile. A mask generated for index 2 only lines up with tile 2.

Seams persist even with the mask. The mask controls where a tile is re-diffused; it doesn't force neighboring tiles to agree on content. If tiles still clash at the borders, add source conditioning (ControlNet Tile) so each stays faithful to the original, and make sure your layout's blending is wide enough. The mask and the merge blend both read that same layout value.

Categoryexternal_tooling/tiles

Inputs (3)

NameTypeDefaultDescription
layoutTileLayout
indexINT0
blendoptBOOLEANfalse

Outputs (1)

NameTypeDescription
maskMASK