Map Generator(Outdoors)
Procgen rivers, roads, and trees — then let img2img do the actual drawing
- image
- image width
- image height
- grid width
- grid height
- grid side
- positive prompt
- negative prompt
Most "AI battlemap" workflows fail at the same step: you prompt a diffusion model for a forest clearing and you get either a generic fantasy painting or a muddy grid of noise, rarely something that matches the 24×32 grid you planned the encounter around. Map Generator(Outdoors) is the pragmatic fix: it procedurally drafts the terrain - rivers, roads, rock clusters, trees, random flowers - and hands you both the draft and a ready-made prompt to refine it. The diffusion model does the pretty painting; this node does the layout, so your river actually runs the direction you want.
How it works
It's a subclass of Map Generator, so it starts with the same exact-size canvas and green background, then layers on hand-rolled procedural geometry. Rivers and roads are generated as branching paths: they start at a random edge, wander toward the center with random angle drift, and occasionally fork into a thinner tributary (recursively, up to five levels deep). Each is drawn with tapered, multi-stroke widths so they read as organic lines rather than 1px scribbles - black under-stroke plus a colored top in fading shades. Rocks are random polygons (3- to 9-sided), trees are radial "star" bursts of darkgreen-to-lightgreen line clusters, and flowers are scattered colored dots. Everything gets a local noise pass so it doesn't look flat.
The smart part is the prompt plumbing. Depending on which toggles are on, it appends tokens to positive ("blue river, water.", "saddlebrown road.") and, when a feature is off, adds the inverse to negative ("trees.", "rocks.") so the img2img pass doesn't hallucinate terrain you explicitly didn't ask for. Feed those two output strings straight into a KSampler's positive/negative and the refinement stays on-rails.
The inputs that matter
The seed, grid_width, grid_height, grid_side, and bg_color inputs are identical to Map Generator (24×32 grid at 32px = 768×1024, green base). On top of that you get four booleans - river, road, rocks, trees - all defaulting to ON, and positive / negative text fields where you can add your own prompt words to the ones it builds. Kill a toggle and it both skips drawing that feature and adds it to the negative prompt.
The outputs
image, plus the same five INTs (image width/height, grid width/height, grid side) so you can wire grid width/grid height into Battlemap Grid's orig_grid_width/orig_grid_height for an aligned overlay. And then the two strings this node exists for: positive prompt and negative prompt, ready for your KSampler.
One quirk to know about: the auto-built prompt in the current code has the tree and rock descriptors swapped - you'll see "green trees." appended when rocks are on and "gray rocks." when trees are on. Harmless, but don't blindly trust the text; it's a starting point, not scripture.
How to install it
The whole pack installs in one go. ComfyUI Manager: search ComfyUI_BattlemapGrid. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/fmatray/ComfyUI_BattlemapGrid
Then install the pack's hidden dependency - no requirements.txt, but aggdraw is imported by the grid node, and its absence kills the entire pack's import:
path/to/ComfyUI/venv/bin/pip install aggdraw
Restart, and it's under Battlemaps. No models to download, runs on CPU.
Common issues
- Refined map ignores your layout - your base draft is guidance, not a hard constraint. If the img2img pass washes it out, drop the denoise a bit and lean on the provided positive prompt.
- Model draws a river you turned off - make sure the negative prompt output is actually wired in; that's precisely what it's for.
- Everything on but the map still looks abstract - the procedural sketch is low-detail by design. Refine it; that's the whole two-stage idea.
It's the most opinionated node in the pack, and the one that actually feels like a battlemap generator rather than scaffolding. Worth the extra few minutes of wiring.
Inputs (11)
| 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 | — |
| river | BOOLEAN | true | — |
| road | BOOLEAN | true | — |
| rocks | BOOLEAN | true | — |
| trees | BOOLEAN | true | — |
| positive | STRING | — | |
| negative | STRING | — |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| image width | INT | — |
| image height | INT | — |
| grid width | INT | — |
| grid height | INT | — |
| grid side | INT | — |
| positive prompt | STRING | — |
| negative prompt | STRING | — |