编程 HY-World 2.0 自托管实录:CUDA 12.8 环境跑通世界重建与四阶段 3D 世界生成

2026-09-27 00:04:02

HY-World 2.0 自托管实录:CUDA 12.8 环境跑通世界重建与四阶段 3D 世界生成

版本动态:2026 年 4 月 16 日发布技术报告与 WorldMirror 2.0;5 月 11 日 HY-Pano 2.0;5 月 18 日开源 World Generation 推理代码与 WorldStereo 2.0 权重;2026 年 7 月 HY World 2.1。

项目定位

HY-World 2.0 是一个多模态世界模型框架,同时覆盖世界生成(World Generation)与世界重建(World Reconstruction)。输入支持文本、单视图图像、多视图图像、视频;输出是 3D 世界表示,即 mesh 或 Gaussian Splatting。

世界生成走四阶段流程:

  1. 全景生成(Panorama Generation),由 HY-Pano 2.0 完成;
  2. 轨迹规划(Trajectory Planning),由 WorldNav 完成;
  3. 世界扩展(World Expansion),由 WorldStereo 2.0 完成;
  4. 世界合成(World Composition),由 WorldMirror 2.0 与 3DGS learning 完成。

世界重建由 WorldMirror 2.0 承担:一个统一的前馈模型,单次前向推理即可预测深度、表面法线、相机参数、3D 点云和 3DGS 属性。

为什么选 3D 世界模型

已有的世界模型(Genie 3、Cosmos、HY-World 1.5)生成的是像素级视频,播放结束就消失。HY-World 2.0 直接产出可编辑、可持久保存的 3D 资产(mesh / 3DGS),能导入 Blender、Unity、Unreal、Isaac Sim。

维度视频世界模型3D 世界模型
输出像素视频,不可编辑真实 3D 资产 mesh/3DGS,可自由编辑
可播放时长通常 1 分钟以内无限制,资产持久存在
3D 一致性无,存在闪烁原生一致
实时渲染逐帧推理,延迟高消费级 GPU 实时渲染
可控性弱精确的零误差控制,真实物理碰撞,准确光照
推理成本每次交互累加一次性生成,渲染成本接近 0
引擎兼容只有视频文件可导入 Blender/UE/Isaac

能力要点

  • 输出真实 3D 世界而非视频:3DGS、mesh、点云,可导入 Unity/Unreal/Isaac;从文本提示或图像出发即可构建可导航的 3D 世界。
  • 从照片和视频即时重建 3D:WorldMirror 2.0 单次前向预测稠密点云、深度图、表面法线、相机参数、3DGS;支持 50K–500K 像素的灵活分辨率推理。
  • 交互式角色探索:第一人称导航与第三人称角色模式,支持基于物理的碰撞。

架构

流水线顺序为:Panorama Generation(HY-Pano-2.0)→ Trajectory Planning(WorldNav)→ World Expansion(WorldStereo 2.0)→ World Composition(WorldMirror 2.0 + Splattings Learning)。

Model Zoo

环节模型参数量年份
世界重建WorldMirror-2~1.2B2026
世界重建WorldMirror-1~1.2B2025
全景生成HY-Pano-2~80B2026
全景生成HY-Pano-2-Qwen~425M2026
世界扩展WorldStereo-2~17B2026

环境搭建

推荐 CUDA 12.8 与 Python 3.11+。只需准备一个共享环境,思路是先把 World Reconstruction(WorldMirror 2.0)跑通,再补 World Generation 的额外组件。

1. 创建共享环境

git clone https://github.com/Tencent-Hunyuan/HY-World-2.0
cd HY-World-2.0
conda create -n hyworld2 python=3.11.15
conda activate hyworld2

2. 安装 World Reconstruction 依赖

pip install -r requirements.txt
# Recommended: install custom gsplat variant once for both worldrecon and worldgen
cd hyworld2/worldgen/third_party/gsplat_maskgaussian
pip install -e . --no-build-isolation
cd ../../../../

# If only worldrecon, official gsplat also supported:
pip install git+https://github.com/nerfstudio-project/gsplat.git

FlashAttention 后端二选一,装一个即可:

# Hopper GPUs: FlashAttention-3
git clone https://github.com/Dao-AILab/flash-attention.git
cd flash-attention/hopper
python setup.py install
cd ../../
rm -rf flash-attention

# Simpler: FlashAttention-2
pip install flash-attn --no-build-isolation

3. 追加 World Generation 依赖(仅在跑 worldgen 时需要)

pip install --no-build-isolation -r requirements_git.txt
git submodule update --init --recursive
cd hyworld2/worldgen/third_party/navmesh
pip install . --no-build-isolation
cd ../../../../

HY-Pano-2 的安装步骤见 hyworld2/panogen/README.md。

代码调用

全景生成(HY-Pano-2)

diffusers 风格的 Python API,首次运行时自动从 Hugging Face 下载权重。

from pipeline import HunyuanPanoPipeline
pipeline = HunyuanPanoPipeline.from_pretrained('tencent/HY-World-2.0')
output = pipeline('input.png')
output.save('output_panorama.png')

世界生成(WorldNav、WorldStereo-2、3DGS)

五个阶段对应五个脚本:

阶段脚本作用
1 Trajectory Planningtraj_generate.pyVLM 引导的相机轨迹规划,带障碍物感知导航
2 Trajectory Renderingtraj_render.py沿规划轨迹做多 GPU 点云渲染
3 World Expansionvideo_gen.pyWorldStereo-2 关键帧生成,带 memory-guided 一致性
4 GS Data Preparationgen_gs_data.py抽取帧、对齐深度、法线、相机参数,供 3DGS 训练
5 3DGS Trainingworld_gs_trainer.py优化并导出最终的 Gaussian Splatting 世界

WorldMirror 2.0

from hyworld2.worldrecon.pipeline import WorldMirrorPipeline
pipeline = WorldMirrorPipeline.from_pretrained('tencent/HY-World-2.0')
result = pipeline('path/to/images')

带先验注入(相机与深度):

result = pipeline('path/to/images', prior_cam_path='path/to/prior_camera.json', prior_depth_path='path/to/prior_depth/')

CLI 单卡与多卡:

# 单 GPU
python -m hyworld2.worldrecon.pipeline --input_path path/to/images

# 多 GPU
torchrun --nproc_per_node=2 -m hyworld2.worldrecon.pipeline --input_path path/to/images --use_fsdp --enable_bf16

多卡模式下,输入图像数量必须 >= GPU 数量。例如 --nproc_per_node=8 时至少要准备 8 张图,否则跑不起来。

Gradio App

python -m hyworld2.worldrecon.gradio_app

# 多 GPU
torchrun --nproc_per_node=2 -m hyworld2.worldrecon.gradio_app --use_fsdp --enable_bf16

上传图像/视频后,可可视化 3DGS、点云、深度图、法线图与相机参数。

性能

WorldStereo 2.0 相机控制:RotErr 0.492、TransErr 0.968、ATE 1.768、Q-Align 4.205、CLIP-IQA+ 0.544、Laion-Aes 5.266、CLIP-I 89.43,对比 SEVA / Gen3C / WorldStereo 为最优。

WorldMirror 2.0 在 7-Scenes / NRGBD / DTU 上的点图重建:H + all priors 取得最优 Acc/Comp,其中 7-Scenes Acc 0.012、Comp 0.016;DTU 为 0.554 / 0.771。表中「L/M/H」分别指低/中/高推理分辨率,「+ all priors」表示注入了相机外参、内参和深度先验。

WorldMirror 2.0 与 Pow3R、MapAnything 在不同先验条件下的对比见原文性能表。

文档

使用指南、参数说明、输出格式与先验注入细节见 DOCUMENTATION.md。

引用

@article{hyworld2026,
  title={HY-World 2.0: A Multi-Modal World Model for Reconstructing, Generating, and Simulating 3D Worlds},
  author={{Team HY-World}},
  journal={arXiv preprint arXiv:2604.14268},
  year={2026},
  url={https://arxiv.org/abs/2604.14268}
}

推荐文章

程序员茄子在线接单