How cssu/terrain-diffusion works
terrain-diffusion is a planned reproduction of InfiniteDiffusion for deterministic, seamless, effectively infinite terrain generation. The main workflow accepts a seed and region, generates overlapping noisy patches, blends them into height grids, and exposes results as files or through an HTTP service for a browser-based 3D view. The README describes the intended architecture, but much of the Python code is still planning documentation and the web app is a placeholder; edges below follow those documented responsibilities where implementation is not present. Model inference, elevation encoding, benchmarking, and optional tile persistence are also represented.
Main entry points: orchestration.py Generation Orchestration · sampler.py Windowed Blending Sampler · pipeline.py Model Pipeline · inference.py Model Inference
Components 15
Terrain Generation
- Generation Orchestration
src/terrain_diffusion/orchestration.py - Windowed Blending Sampler
src/terrain_diffusion/sampler.py
Model Processing
- Model Pipeline
src/terrain_diffusion/pipeline.py - Model Inference
src/terrain_diffusion/inference.py - Elevation Encoding
src/terrain_diffusion/encoding.py
User Interfaces
- Output and CLI
src/terrain_diffusion/cli.py - 3D Visualizer
web - Generation Service
src/terrain_diffusion/service.py
Evaluation and State
- Terrain Store
src/terrain_diffusion/store.py - Benchmarking and Evaluation
src/terrain_diffusion/benchmark.py
Other components
- User
- Pretrained Weights
- GPU Compute
- Local Disk Cache
- Output Files
Connections 16
- User → Output and CLI: requests terrain
- User → 3D Visualizer: explores terrain
- Output and CLI → Generation Orchestration: requests region
- Generation Orchestration → Windowed Blending Sampler: generates region
- Windowed Blending Sampler → Model Pipeline: cleans patches
- Model Pipeline → Model Inference: runs models
- Model Pipeline → Elevation Encoding: decodes elevations
- Windowed Blending Sampler → Terrain Store: writes and reads tiles
- Generation Orchestration → Terrain Store: reads height grids
- Output and CLI → Output Files: writes results
- 3D Visualizer → Generation Service: requests over HTTP
- Generation Service → Generation Orchestration: requests region
- Benchmarking and Evaluation → Generation Orchestration: evaluates generation
- Model Inference → Pretrained Weights: loads weights
- Model Inference → GPU Compute: runs inference
- Terrain Store → Local Disk Cache: persists tiles