Talus: A 23M-Parameter Diffusion Model That Generates Game Terrain via Browser WebGPU

Talus is a 23M-parameter diffusion model generating game terrain in-browser via WebGPU in ~3 seconds.
Talus is a lightweight open-source diffusion model with just 23M parameters that generates 64×64 game terrain heightmaps — covering roughly 4 km and 1,200 m of elevation — in about 3 seconds via browser WebGPU. It supports flexible conditioning on terrain type and any subset of five measurable attributes using learnable "unknown" embeddings. Trained on 45,000 procedurally generated maps using a single RTX 5060 in ~4.5 hours, its standout contribution is an evaluation framework that normalizes all metrics against a real-vs-real noise floor, making a score of 1.0 mean "statistically indistinguishable from real data." Current test scores are 1.51× for terrain metrics, 9.1× for spectral distance, and 1.65× for slope. Code, weights, and scorecard are Apache-2.0 licensed with a live demo available.
A diffusion model with just 23 million parameters that generates game terrain heightmaps in real time inside a browser using WebGPU — that's Talus, an open-source project posted to Reddit by developer osfv. Beyond its lightweight footprint, it introduces an evaluation methodology worth studying: a "real-vs-real" noise baseline for measuring generation quality. For developers interested in small diffusion models, procedural terrain generation, or browser-side AI inference, this project offers plenty of engineering details worth unpacking.
What the Model Does
Talus generates 64×64 heightmaps representing roughly 4 km of terrain at up to 1,200 meters of elevation. Generation can be conditioned on two types of inputs: terrain type, and any subset of five measurable attributes — mean elevation, relief, mean slope, water coverage, and spectral slope.
The "any subset" design is key. Each attribute has a learnable "unknown" embedding vector and is independently dropped at random during training, so at inference time the model handles any combination of specified or unspecified attributes gracefully. This is essentially flexible multi-condition dropout, letting a single model cover the full range from "unconstrained generation" to "precisely constrained generation."
Training and Data: A Consumer GPU Workflow
The entire model was trained from scratch on a single RTX 5060 (8 GB VRAM) over approximately 4.5 cumulative hours across multiple training runs. That figure is notable: it demonstrates that, with well-scoped tasks and a reasonable dataset, diffusion models don't necessarily require expensive compute.
Training data consists of 45,000 maps generated by the author's own procedural generator, which uses fBm/ridged noise, stream-power erosion, hillslope diffusion, and thermal erosion. In other words, the model learns the statistical distribution of an existing procedural pipeline, then compresses and generalizes it through diffusion. The architecture uses a pixel-space U-Net with v-prediction objective, cosine noise schedule, 50-step DDIM sampling with quadratic spacing, and classifier-free guidance at strength 2.0 — a solid, conservative configuration for a small model.
Background: fBm (Fractional Brownian Motion) is the foundational noise-stacking method in procedural terrain generation, simulating self-similar roughness by layering noise at multiple frequencies and amplitudes. Ridged noise is a variant that takes the absolute value and inverts it, producing sharp ridge-like forms. Stream-power erosion simulates water carving downslope along flow paths, producing dendritic drainage networks and V-shaped valleys. Hillslope diffusion simulates gravity-driven short-range soil displacement, smoothing steep slopes and rounding ridgelines. Thermal erosion models debris accumulation from freeze-thaw rock fracture, commonly used to generate scree slopes and talus cones — the latter being the origin of the project's name. Used together, these four algorithms produce geologically plausible terrain rather than raw "fake mountains" from pure noise. Training a diffusion model on this physically grounded procedural data effectively compresses explicit geomorphic rules into implicit model weights.
Relative Elevation: Fixing Over-Textured Plains
One interesting engineering decision is the "relative elevation" formulation. Rather than generating absolute heights, the model generates terrain shape normalized by relief, which the sampler then places at the user-specified mean elevation and relief. When those values aren't specified, they're borrowed from the 16 nearest training maps.
The author notes this change directly fixed excessive graininess in flat terrain — the distance ratio for plains dropped from 3.98 to 1.23. Decoupling "shape" from "scale" is an effective burden-reduction strategy for small models: the model only needs to learn landform geometry, without also memorizing the vast dynamic range of absolute elevation values.
Evaluation: Benchmarking Against a Real-vs-Real Noise Floor
The most transferable part of Talus is its evaluation framework. Most generative model evaluations lack an absolute reference for "how good is good enough." Talus addresses this by dividing all distance metrics — W1 distances across 25 per-map terrain measurements, radially averaged power spectrum, and height and slope distributions — by a single baseline: the distance between two disjoint sets of real maps.
This makes the metric intuitive: a score of 1.0 means generated results are statistically indistinguishable from real maps at the current sample size. The real-vs-real noise floor sets a theoretical upper bound on scoring, avoiding misinterpretation of raw absolute error values.
The evaluation process is also reasonably rigorous: checkpoints are selected on a validation set, the test set is scored only once for the final chosen model, and memorization is checked by comparing against the training set. The current model's test-set performance: metric W1 distance at 1.51× baseline, spectral at 9.1×, slope at 1.65×. Metric and slope scores are close to baseline, but spectral distance remains a clear gap.
Background: W1 distance (first-order Wasserstein distance, also called "earth mover's distance") measures the minimum "transport cost" between two probability distributions — intuitively, how far you'd need to move one distribution's "dirt" to reshape it into the other. Unlike KL or JS divergence, W1 remains meaningful even when distributions don't overlap, making it widely used in generative model evaluation. The radially averaged power spectrum takes the 2D Fourier transform and averages by frequency radius, yielding a curve describing how energy is distributed across spatial frequencies — low frequencies correspond to large-scale landform relief, high frequencies to fine textures and ridgelines. A spectral distance of 9.1× means generated terrain differs significantly from real maps in high-frequency energy distribution, directly quantifying the distortion in ridgelines and fine-grained detail. Normalizing all distances by the real-vs-real baseline makes results comparable across datasets and tasks, rather than relying on absolute values that are hard to interpret intuitively.
Running in the Browser: 3-Second Generation via WebGPU
For deployment, Talus is exported to ONNX format with weights stored in fp16 (converted back to fp32 at load time), running via ONNX Runtime Web on WebGPU, generating one map in roughly 3 seconds on the author's RTX 5060, with a CPU fallback available.
One engineering detail worth highlighting: the author reimplemented the sampler in JavaScript and verified that its output differs from the PyTorch reference by no more than 0.6 meters on reference samples. This kind of cross-language numerical consistency check is a necessary step for turning a research prototype into a real browser product. A live demo is available at talus.tersa.tech, and code, weights, and scorecard are all open-sourced under Apache-2.0 on GitHub.
Background: WebGPU is the W3C's next-generation web graphics and compute API, which shipped in Chrome in 2023 as a replacement for the aging WebGL. Unlike WebGL, WebGPU supports compute shaders, enabling general-purpose GPU parallel computation — including neural network inference — to run efficiently directly in the browser without server-side forwarding. ONNX (Open Neural Network Exchange) is a cross-framework model serialization format that allows models trained in PyTorch, TensorFlow, and others to be exported to a unified intermediate representation and executed by platform-specific runtimes. ONNX Runtime Web is its browser-adapted version, automatically selecting WebGPU, WebGL, or WASM backends. fp16 (half-precision floating point) halves storage size compared to fp32, improving bandwidth efficiency for WebGPU; converting back to fp32 at compute time preserves numerical precision and avoids quality degradation in small models. This "fp16 storage + fp32 compute" pattern is a common trade-off in edge inference today.
Open Problems
The author honestly lists several unsolved challenges: ridgelines and the finest spectral bands are difficult to reproduce, mountain terrain comes out too smooth, and plains are still somewhat grainy. The 9.1× spectral distance confirms this — small diffusion models generally struggle with high-frequency detail. The author has also put out an open call: if anyone has successfully closed a similar spectral gap in small diffusion models, they'd welcome the experience.
Takeaways for Developers
Talus is more than just "another terrain generator." It demonstrates several things: with a well-defined task, a 23M-parameter model on a consumer GPU can produce usable results; normalizing evaluation against a real-vs-real baseline is more informative than reporting raw loss values; and there's a complete engineering path for taking a research prototype into the browser via ONNX + WebGPU. For anyone looking to build lightweight generative models and actually ship them to users, this is a technically detailed reference case worth studying.
Related articles

How Big Can Stars Really Get? The Physical Limits of the Largest Stars
Red supergiants are the largest stars by volume, with radii up to 2,000 times the Sun, engulfing the inner solar system. But there is no precise upper limit on stellar size—models predict up to 15,000 solar radii. The most massive blue stars are far smaller than red supergiants—biggest and heaviest are two different things.

Apple HomeView Smart Display Full Feature Breakdown: Wall-Mount or Desktop, $299
Apple launches HomeView, a $299 smart display with wall-mount and desktop options, 12MP camera for facial recognition, smart home control, music playback, and recipe step-by-step cooking. Full breakdown of watch faces, apps, privacy, and cooking integration.

Where Did the Promised New Studio Go? Craft Computing Answers After Five Years
Craft Computing's host responds to viewer questions: the new studio promised five years ago was shelved as construction costs soared from $30,000 to $75,000, and was replaced by a 168-square-foot garage conversion.