Map Generator
A battlemap base generator that needs zero models and zero downloads
- image
- image width
- image height
- grid width
- grid height
- grid side
Here's the thing nobody tells you about AI battlemaps: the map itself is the easy part, the boring scaffolding around it is the work. You need a canvas that's exactly the right pixel size for your grid, with a base color that will composite cleanly, and you need to know those dimensions precisely when you're done. Map Generator exists to be that scaffolding. It's not a map generator in the "wow, a finished dungeon!" sense - it produces a deliberately plain, speckled color field you then feed into an img2img step (or the outdoors variant) to get something resembling terrain. Think of it as the green-screen in a two-stage pipeline.
How it works
Pure procedural code, zero ML. Given grid_width, grid_height, and grid_side, it creates a canvas of exactly grid_width × grid_side pixels by grid_height × grid_side pixels - the defaults (24 × 32 × 32px) give you a 768×1024 map, the classic portrait VTT ratio. It fills that canvas with your bg_color (default #00FF00, i.e. chroma-key green - not an accident), jitters the color slightly per 5px tile, and sprinkles per-pixel noise over the whole thing. Deterministic per seed, runs on CPU in a blink, and there's no GPU or checkpoint anywhere in sight.
The green default is worth understanding: a flat, distinct base color is exactly what you want to either mask away or inpaint over in the refinement pass. If you've ever chased a workflow that refused to run because some node was missing a model, this pack is the opposite of that - it has no models at all.
The inputs and outputs that matter
Five inputs, three of which you'll touch:
- seed - same seed, same map, every time.
- grid_width and grid_height - your battlemap's grid count, 10–128 each. 24×32 is a solid starting point.
- grid_side - pixels per grid cell, 10–2048.
- bg_color - a hex string. Keep the green unless you know why you're changing it.
The outputs are where this node earns its keep. Alongside the image it returns image width, image height, grid width, grid height, and grid side as plain INTs. Those feed the rest of the pack: wire grid width and grid height into the Battlemap Grid node's orig_grid_width/orig_grid_height inputs, and the grid overlay will align itself to your cells even after upscaling. It's the connective tissue that makes the whole workflow coherent.
How to install it
Same tiny install as every node in this pack. ComfyUI Manager: search ComfyUI_BattlemapGrid. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/fmatray/ComfyUI_BattlemapGrid
Then the one hidden dependency - the pack has no requirements.txt, but the grid node imports aggdraw, and without it the whole pack fails to import:
path/to/ComfyUI/venv/bin/pip install aggdraw
Restart ComfyUI and you'll find it under Battlemaps. Nothing else to download.
Common issues
- Map looks plain/ugly - that's the point. This is a base layer for img2img, not a finished map. If you want procedural structure already in place, use Map Generator(Outdoors) instead.
- ComfyUI runs out of memory - the input ranges are loose, and
grid_width128 ×grid_height128 ×grid_side2048 works out to a 268-megapixel image that will make your machine sad. Keep grid counts modest; for a VTT map you rarely need more than 24×32 cells. - Same seed, different result across sessions? - shouldn't happen; the generator reseeds from
seedon every run, so it's deterministic as long as you feed the same seed.
A glorified rectangle factory, honestly - but it's the rectangle factory the rest of this pack is built around.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00–18446744073709550000 | — |
| grid_width | INT | 2410–128 | — |
| grid_height | INT | 3210–128 | — |
| grid_side | INT | 3210–2048 | — |
| bg_color | STRING | #00FF00 | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| image width | INT | — |
| image height | INT | — |
| grid width | INT | — |
| grid height | INT | — |
| grid side | INT | — |