Terrain Diffusion Fabric 模组
这是一个将 Terrain Diffusion 集成到 Minecraft Fabric 的模组。
要求
- 已安装 Fabric 和 Fabric API Mod 的 Minecraft
- Windows 系统且配备 GPU。对于 Linux 或仅使用 CPU 的情况,请参阅 GitHub
- 所需显存 (VRAM):1.5GB
- 所需内存 (RAM):2.5GB(可能需要增加 Minecraft 的内存分配)
使用方法
- 从 Releases 下载与您 Minecraft 版本对应的模组 jar 文件,并将其放入您的 Minecraft
mods/ 文件夹中。请确保 Minecraft 版本匹配。
- 启动 Minecraft,至少在线运行一次以下载模型(约 2.5GB)。
- 创建一个世界,并选择 Terrain Diffusion 世界类型。点击 Customize 以设置
World Scale(参见下方的 按世界设置)。
探索世界
该模组包含一个内置的地形浏览器 Web UI。在游戏中运行 /td-explore 命令;它将打印一个可点击的链接(例如 http://localhost:19801),在浏览器中打开交互式地图。点击左侧的地图以打开“详细视图”。点击详细视图可在左下角获取坐标。您还可以筛选特定的气候类型。
在使用 Minecraft 进行冒险之前,请使用浏览器来侦察大陆、山脉、岛屿和其他有趣的地形。
配置
编辑 config/terrain-diffusion-mc.properties(首次启动时自动创建):
# Terrain Diffusion MC configuration
# 推理设备:"cpu"、"gpu" 或 "auto"(优先尝试 GPU,然后回退到 CPU)。
# "gpu" 在 -windows 构建版中使用 DirectML,或在 -cuda 构建版中使用 CUDA。
# GPU 构建版默认设置为 "gpu",因此如果未检测到 GPU,启动时会报错。
# CPU 构建版默认设置为 "auto":在 macOS 上使用 CoreML,否则使用 CPU。
inference.device=gpu
# 在管道阶段之间将非活动模型从显存卸载。
# 将峰值显存保持在 ~1.5-2 GB。如果您有 ~2.5+ GB 的可用内存并希望获得稍快的生成速度,请将其设置为 false。
inference.offload_models=true
# 验证 .minecraft/terrain-diffusion-models 中现有文件的 SHA-256 哈希值。
# 如果您希望提供自定义模型/配置文件而无需哈希检查,请将其设置为 false。
validate_model=true
# 本地地形浏览器 Web UI (/td-explore) 的端口。
explorer.port=19801
# 出生点搜索:用于在 (0, 0) 附近寻找陆地出生点的粗粒度区域大小。
# 从 initial_size x initial_size 开始,每步扩大 8,直到 max_size x max_size。
# 每个粗粒度像素覆盖大片区域(数百个方块),因此 16–128 通常就足够了。
spawn_search.initial_size=16
spawn_search.max_size=128
按世界设置
对于 Terrain Diffusion 世界,在世界创建界面点击 Customize 并设置:
此值随世界存档保存,并影响:
- 每个方块代表的实际米数(
scale=1 => 30m/block,scale=2 => 15m/block,依此类推)
- 新创建世界的最大高度(假设最高点为 10000 实际米)
- 推荐值为 2,以在规模和可玩性之间取得良好平衡。使用 1 可获得更小、更紧凑的世界。
- 较低的值会给 GPU 带来更大压力(Terrain Diffusion 运行得更频繁),而较高的值会给 CPU 带来更大压力(世界高度更大)。大多数现代 GPU 在比例 2 或 3 左右时可能会受到 CPU 的限制。
常见问题
动态链接库 (DLL) 初始化例程失败
这可能会发生在某些旧版 Java 上。请更新到最新版本的 Java 21 或更高版本。最新的 Microsoft OpenJDK 21 版本已知可以正常工作。
LoadLibrary failed with error 126 (仅限 CUDA 构建版)
这通常是由于 CUDA 或 cuDNN 安装不当所致。请参阅 CUDA_INSTALL.md 中的故障排除步骤。
java.lang.IllegalStateException: Failed to load terrain-diffusion models
这通常表明出现“内存不足”错误(日志中也应显示此信息)。
Terrain Diffusion 的模型占用约 2.5GB 的 RAM,因此请确保分配足够的内存以容纳这些模型。
如果您的问题仍未解决,请在此处 提出。
Terrain Diffusion Fabric Mod
This is a Minecraft Fabric mod integrating Terrain Diffusion.
Requirements
- Minecraft with Fabric and the Fabric API Mod installed
- Windows with a GPU. For Linux or CPU, please see the GitHub
- VRAM (GPU RAM) needed: 1.5GB
- RAM needed: 2.5GB (May need to increase Minecraft's RAM allocation)
Usage
- Download the mod jar from Releases for your Minecraft version and place it in your Minecraft
mods/ folder. Make sure the Minecraft version matches.
- Launch Minecraft, at least once online to download the models (~2.5GB).
- Create a world, and select the Terrain Diffusion world type. Click Customize to set the
World Scale (see Per-world settings below).
Exploring the World
The mod includes a built-in terrain explorer web UI. Run the /td-explore command in-game; it will print a clickable link (e.g. http://localhost:19801) that opens an interactive map in your browser. Click the map on the left to open a "detailed view". Click the detailed view to get coordinates in the bottom left. You can also filter for certain climates.
Use the explorer to scout continents, mountains, islands, and other interesting terrain before venturing out in Minecraft.
Configuration
Edit config/terrain-diffusion-mc.properties (created automatically on first launch):
# Terrain Diffusion MC configuration
# Inference device: "cpu", "gpu", or "auto" (try GPU first then fall back to CPU).
# "gpu" uses DirectML on the -windows build, or CUDA on the -cuda build.
# GPU builds default to "gpu" so startup fails loudly if no GPU is detected.
# CPU build defaults to "auto": uses CoreML on macOS, otherwise CPU.
inference.device=gpu
# Offload inactive models from VRAM between pipeline stages.
# Keeps peak VRAM to ~1.5-2 GB. Set to false if you have ~2.5+ GB free for slightly
# faster generation.
inference.offload_models=true
# Validate SHA-256 for pre-existing files in .minecraft/terrain-diffusion-models.
# Set to false if you want to provide custom models/config files without hash checks.
validate_model=true
# Port for the local terrain explorer web UI (/td-explore).
explorer.port=19801
# Spawn search: coarse-pixel region sizes for finding a land spawn near (0, 0).
# Starts at initial_size x initial_size and expands by 8 each step up to max_size x max_size.
# Each coarse pixel covers a large area (hundreds of blocks), so 16–128 is typically sufficient.
spawn_search.initial_size=16
spawn_search.max_size=128
Per-world settings
For Terrain Diffusion worlds, click Customize in world creation and set:
World Scale (integer 1..6)
This value is saved with the world save and affects:
- how many real-world meters each block represents (
scale=1 => 30m/block, scale=2 => 15m/block, etc.)
- world max height for newly created worlds (assumes tallest point is 10000 real-world meters)
- 2 is recommended for a good balance of scale and playability. Use 1 for smaller, more compressed worlds.
- Lower values put more stress on the GPU (Terrain Diffusion runs more often), while higher values put more stress on the CPU (larger world height). Most modern GPUs will be bottlenecked by the CPU around scale 2 or 3.
Common Issues
A dynamic link library (DLL) initialization routine failed
This can happen for some older Java versions. Please update to the most recent version of Java 21 or higher. The latest Microsoft OpenJDK 21 version is known to work.
LoadLibrary failed with error 126 (CUDA build only)
This is typically due to an improper CUDA or cuDNN installation. See CUDA_INSTALL.md for troubleshooting steps.
java.lang.IllegalStateException: Failed to load terrain-diffusion models
This typically indicates an "out of memory" error (the logs should show this as well).
Terrain Diffusion's models take up about 2.5GB of RAM, so make sure to allocate enough RAM to account for this.
If your issue is still not resolved, please raise it here.
评论 0
登录后参与评分
还没有评论,来抢沙发吧