模型名称: TRELLIS.2-4B
论文: https://arxiv.org/abs/2512.14692
代码库: https://github.com/microsoft/TRELLIS.2
项目页面: https://microsoft.github.io/trellis.2
TRELLIS.2 是一款先进的大型 3D 生成模型,专为高保真图像转 3D 生成而设计。它采用了一种名为O-Voxel的新型“无场”稀疏体素结构,并配备了大规模流匹配Transformer(40亿参数)。
与以往依赖等值面场(如 SDF、Flexicubes)的方法不同——这些方法在处理开放表面或非流形几何时存在困难——TRELLIS 能够重建和生成具有复杂拓扑结构、锐利特征以及完整基于物理渲染(PBR)材质(包括透明/半透明效果)的任意 3D 资产。
| 分辨率 | 时间 |
|---|---|
| 512³ | ~3秒 |
| 1024³ | ~17秒 |
| 1536³ | ~60秒 |
我们正在积极改进模型并解决这些限制。
注:安装说明和依赖项请参考官方GitHub仓库。
import os
os.environ['OPENCV_IO_ENABLE_OPENEXR'] = '1'
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True" # Can save GPU memory
import cv2
import imageio
from PIL import Image
import torch
from trellis2.pipelines import Trellis2ImageTo3DPipeline
from trellis2.utils import render_utils
from trellis2.renderers import EnvMap
import o_voxel
# 1. Setup Environment Map
envmap = EnvMap(torch.tensor(
cv2.cvtColor(cv2.imread('assets/hdri/forest.exr', cv2.IMREAD_UNCHANGED), cv2.COLOR_BGR2RGB),
dtype=torch.float32, device='cuda'
))
# 2. Load Pipeline
pipeline = Trellis2ImageTo3DPipeline.from_pretrained("microsoft/TRELLIS.2-4B")
pipeline.cuda()
# 3. Load Image & Run
image = Image.open("assets/example_image/T.png")
mesh = pipeline.run(image)[0]
mesh.simplify(16777216) # nvdiffrast limit
# 4. Render Video
video = render_utils.make_pbr_vis_frames(render_utils.render_video(mesh, envmap=envmap))
imageio.mimsave("sample.mp4", video, fps=15)
# 5. Export to GLB
glb = o_voxel.postprocess.to_glb(
vertices = mesh.vertices,
faces = mesh.faces,
attr_volume = mesh.attrs,
coords = mesh.coords,
attr_layout = mesh.layout,
voxel_size = mesh.voxel_size,
aabb = [[-0.5, -0.5, -0.5], [0.5, 0.5, 0.5]],
decimation_target = 1000000,
texture_size = 4096,
remesh = True,
remesh_band = 1,
remesh_project = 0,
verbose = True
)
glb.export("sample.glb", extension_webp=True)如果您发现此模型对您的研究有所帮助,请引用我们的成果:
@article{
xiang2025trellis2,
title={Native and Compact Structured Latents for 3D Generation},
author={Xiang, Jianfeng and Chen, Xiaoxue and Xu, Sicheng and Wang, Ruicheng and Lv, Zelong and Deng, Yu and Zhu, Hongyuan and Dong, Yue and Zhao, Hao and Yuan, Nicholas Jing and Yang, Jiaolong},
journal={Tech report},
year={2025}
}本模型基于 MIT 许可协议发布。代码和数据集已公开,以方便复现和进一步研究。