Wang Boundaries (from Tiles)
Re-seed a new set from an old one
- tiles
- tileset
- IMAGE
- MASK
- TILESET
RandomWangBoundaries needs a source image; this node doesn't. Wang Boundaries (from Tiles) takes a tile set you've already got - from an earlier pass, from another workflow, or straight out of a TileUnpacking - and recombines their edges into fresh Wang boundary conditions. Same idea as the random version, one step further along: instead of sampling the source texture, it treats your existing tiles as the new texture library.
That matters more than it sounds. Tile sets generated from scratch each have their own "voice"; if you want a second, related set - say, more variants, or a matching set that plugs into the same Wang edge labels - building boundaries from tiles you already trust keeps everything coherent. It's also the natural loop: generate a first pass, feed it back in, and you can keep producing compatible tiles until you have more variety than the source could ever give you. The mechanism is exactly the pack's paper trick (Sartor & Peers, ACM TOG 2024): keep exterior boundaries fixed, inpaint the interiors.
Inputs and outputs
- tiles (IMAGE) - your existing tile batch
- tileset (TILESET, forceInput) - carries kind, colors, resolution, and candidates from wherever the tiles came from
- candidates (INT, default 1) - how many candidate boundary copies per tile variant to emit
The source has a nice special case: if your tileset is wang and the tiles come in at resolution * 2 (uncropped, with the seam margins still on), it uses them directly instead of re-cropping - so you don't lose the overlap data you may want to preserve.
Outputs: IMAGE (new exterior boundaries), MASK (the inpaint region), and TILESET (kind wang, with your requested candidates). Standard continuation: InpaintModelConditioning + KSampler (or RollingKSampler), then RejectCandidateTiles, TilePacking, RandomTiling.
Installing and notes
Same as every node in the pack: git clone https://github.com/samsartor/content_aware_tiles into ComfyUI/custom_nodes (or ComfyUI Manager → "content_aware_tiles") and restart. No extra model downloads - bring your own checkpoint; the bundled workflow uses an SD2 inpainting model.
The practical gotcha is the same forceInput one that bites everywhere in this pack: the TILESET must come from a real upstream node (a boundary node or TileUnpacking), not a manual value, or the port stays red. Also note this node builds Wang boundaries specifically - if you're after the pack's fancier Dual scheme, that's DualBoundaries, which accepts Wang tiles as its input and upgrades them. And as with all research-pack code, assume you're self-supporting: no community threads, but the node is ~30 readable lines and the example workflow shows the exact wiring.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| tiles | IMAGE | — | |
| tileset | TILESET | — | |
| candidates | INT | 1 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |
| TILESET | TILESET | — |