36 Prompts, One Infinite City

Community Article Published June 10, 2026

Wave Function Collapse turns AI-generated 3D tiles into an endless, explorable London.

In the last post an agent chained two Hugging Face Spaces to turn prompts into 3D monuments. This time we pushed one step further: what if the generated assets were not the destination, but the vocabulary of something bigger?

The result is Infinite London: every visit procedurally collapses a brand-new Victorian city out of 36 AI-generated 3D tiles. Streets connect, garden squares open up, Big Ben spawns rarely on the skyline, and the world materializes forever at the horizon as you roam it with WASD.

👉 mishig/infinite-london

Generation is expensive. Algorithms are the multiplier.

Text-to-3D is slow: minutes per asset on a shared GPU. You cannot generate a city on demand. But you do not need to. The trick is an old one from game development: Wave Function Collapse (WFC), an algorithm that assembles modular tiles into endless coherent arrangements by matching edge sockets, the way a sudoku solver fills a grid: every cell starts as a superposition of all possible tiles, and observing one collapses its neighbors.

WFC has always had one bottleneck: someone has to make the tileset. That someone used to be a 3D artist. Now it is a prompt loop:

  1. Tile images: ideogram-ai/ideogram4 generated each tile as an isometric game-kit specimen on black. One prompt per tile.
  2. 3D meshes: microsoft/TRELLIS.2 reconstructed each image into a textured GLB, which we then simplified ~12× for instanced rendering in the browser.

Both Spaces were driven end-to-end by an agent reading their agents.md specs.

The Agents button on a Hugging Face Space *Every Gradio Space on the Hub has an Agents button: copy the agents.md instructions straight into your coding agent.* The split of labor is the point: **36 expensive generations, cached once. Infinite cities, free, in the browser, forever.** The marginal cost of a new world is a random seed.

The grammar

The 36 tiles follow a simple socket grammar. Each edge is either open paving or street, and WFC only places tiles whose edges agree:

  • 10 grounds: squares, parks, markets, fountains, a bandstand, an abbey garden
  • 12 streets: straights, corners, T-junctions, a crossroads, bridges, a zebra crossing, a bus stop, tree-lined avenues
  • 9 buildings: Georgian terraces, Victorian brick, stucco townhouses, a corner pub, a docklands warehouse
  • 3 rare landmarks: Big Ben, a St Paul's dome, a monument column
  • 2 street end-caps: a red phone box cul-de-sac, a black cab stand
street pub big ben
park georgian terrace st pauls

Every tile is an inspectable GLB on the Hub. Here is the black-cab stand, fresh out of the pipeline:

Prompt like a game-kit artist

The first attempt at a tileset failed in an instructive way. Prompting for picturesque scenes produces beautiful images that reconstruct into incoherent worlds: backdrop walls become floating planes, vignette bases tear the grid, and every cell boundary is a visible seam.

First attempt: a scene Fixed: a kit piece
v1 tile v2 tile

The fix was to prompt like a modular-kit artist instead of a photographer: flat slab grounds, routes running flush edge to edge, solid freestanding buildings complete from all four sides, perfect square footprints, no backdrops. Same models, same pipeline. The difference between chaos and a city was entirely in the design language of 36 prompts.

The viewer

The browser side is plain three.js, no build step. A few details that make it feel alive:

  • Chunked infinite WFC: the world solves in 8×8-cell chunks around the camera, deterministically from seed + chunk coords, so walking back always finds the same streets. Far chunks are evicted; the world is infinite in every direction.
  • The frontier is visible: uncollapsed cells render as faint pulsing squares, probability fog that resolves into architecture as you approach. Sprint toward the edge and you can watch the city decide what it is.
  • Never stationary: the camera drifts forward perpetually; your input steers.
  • Shareable worlds: every world is a seed. Click it, send the link, and someone else stands in your exact London.

Try it

Roam the city, press R for a new world, or paste an agents.md link into your own coding agent and generate a different city entirely. A new theme is 36 prompts away.

👉 mishig/infinite-london · sibling galleries: Paris · Japan · Egypt

Community

Sign up or log in to comment