查看 Markdown

TRELLIS.2

TRELLIS.2 是微软开源的 40 亿参数图像转 3D 模型。它把物体的形状作为网格返回,网格分辨率最高 1536^3。LibreYOLO 通过 LibreGen 工厂用纯 PyTorch 运行同样的权重,只输出几何。

任务
3d generation
尺寸
4b at 1024 px
安装
pip install "libreyolo[gen]"
支持层级
兄弟层级,自 v1.8.0 起。一个独立的产品面,有自己的工厂和契约。
上游
TRELLIS.2,由 Microsoft Research 发布,采用 DINOv3 License 许可。论文、源码
许可
代码采用 MIT,权重采用 MIT and DINOv3 License。商用

安装

bash
pip install "libreyolo[gen]"

这个 extra 会带上 transformers,用来加载 DINOv3 图像编码器。

预测

没有任何内容需要申请访问,也不需要登录。权重在首次使用时按固定版本下载。

Python
from libreyolo import LibreGen, SAMPLE_IMAGE model = LibreGen("trellis2")        # 也可以写 "trellis.2"result = model(SAMPLE_IMAGE, seed=0) result.save("object.obj")m = result.meshesprint(m.vertices[0].shape, m.faces[0].shape, m.seed)
CLI
# 把物体以 .obj 保存到 runs/generate/predict 下libreyolo generate source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/guggenheim-bilbao.jpg model=trellis2 seed=0
设置
from libreyolo import LibreGen, SAMPLE_IMAGE model = LibreGen("trellis2")result = model(SAMPLE_IMAGE, resolution=512)    # 只有一个形状阶段,更快result = model(SAMPLE_IMAGE, resolution=1536)   # 最精细的网格

结构阶段确定被占据的体素,形状阶段在这些体素上填充潜变量(先在 512,再在 1024 或 1536 上重复一次),一个稀疏解码器再把它转成对偶网格(dual grid)上的网格。两个 flow 阶段都读取 DINOv3 ViT-L/16 的 token。上游需要只支持 CUDA 的扩展(FlexGEMM、flash-attn、o-voxel);LibreYOLO 用纯 PyTorch 运行同样的权重,支持英伟达 GPU、Apple Silicon 和 CPU。噪声在 CPU 上抽取,所以同一个种子在每种设备上给出同一个物体,差别只在内核的舍入误差。

result.meshes 存放网格:vertices (V, 3),z 轴朝上,范围 [-0.5, 0.5]^3,以及 faces (F, 3)。它只有几何,而且是原始的对偶网格,没有经过上游的 CuMesh 清理:面的绕序不一致,有些顶点没有被使用。上游的纹理阶段用 nvdiffrast(英伟达的非商用库)烘焙,不属于 LibreYOLO。

库在 A100 上测得一个 1024 的物体需要 19.5 秒、显存峰值 14.3 GB,512 时需要 5.5 秒、11.6 GB。

设置

设置默认值含义
steps12采样步数。
guidance7.5无分类器引导(classifier-free guidance)。
resolution1024输出网格分辨率:512、1024 或 1536。
margin1.0裁剪边长与物体尺寸之比。
max_tokens49152级联的 token 预算;为了放得下,它可能会降低分辨率,实际使用的分辨率记录在 params 里。

变体

一个尺寸,4b:5 个网络共 40 亿参数,约 8.7 GB,另加 DINOv3 编码器的 1.2 GB 和来自 TRELLIS 镜像的 1.3 GB。

导出

任务ONNXTorchScriptExecuTorchTensorRTOpenVINOPaddleMNNRKNNAxelerancnnTFLiteCoreMLCore AI
3D generation3D generation to ONNX:不支持3D generation to TorchScript:不支持3D generation to ExecuTorch:不支持3D generation to TensorRT:不支持3D generation to OpenVINO:不支持3D generation to Paddle:不支持3D generation to MNN:不支持3D generation to RKNN:不支持3D generation to Axelera:不支持3D generation to ncnn:不支持3D generation to TFLite:不支持3D generation to CoreML:不支持3D generation to Core AI:不支持

LibreGen 的 3D 家族没有实现导出。export()、train() 和 val() 会抛出 NotImplementedError(见库里的 ADR 0031)。

许可证

请检查你所下载的具体权重在 Hugging Face 仓库中的许可。LibreYOLO 组织里的每个检查点都附有许可,同一家族内也不一定相同。该仓库是权威来源;以下摘要说明本页上次验证时适用的情况。

这里只说明涉及的许可证,不构成法律意见。如果答案对商用很重要,请自行阅读许可证并咨询法律顾问。

原始工作
TRELLIS.2, Microsoft Research
上游许可
DINOv3 License
LibreYOLO 代码
MIT
权重
采用 MIT and DINOv3 License 许可,重新发布在 huggingface.co/LibreYOLO
解读
The TRELLIS.2 code and its microsoft/TRELLIS.2-4B weights are MIT, a permissive license that allows commercial and closed-source use with the copyright notice kept. The image encoder it needs is not: facebook/dinov3-vitl16-pretrain-lvd1689m is Meta's, under the DINOv3 License, a custom agreement that is not OSI-approved. It permits redistribution with a copy of the agreement and passes through trade-control and end-use restrictions (military, weapons, espionage and nuclear uses among them), so it sets the terms for the pipeline as a whole; read it before shipping a product on it. LibreYOLO's adapter is MIT, and the flow models, VAE decoder and dual-grid meshing it adapts from TRELLIS.2 keep MIT, noted in libreyolo/models/gen/trellis2/NOTICE. Upstream's nvdiffrast and nvdiffrec (NVIDIA, non-commercial) and BRIA's RMBG-2.0 (non-commercial) are not used, and the texture stage is not ported. Weights are redistributed unchanged at pinned revisions and none is gated: the geometry networks as LibreYOLO/LibreTRELLIS2-4b, TRELLIS's structure decoder and the BiRefNet weights (MIT) from LibreYOLO/LibreTRELLISl, and the DINOv3 encoder as LibreYOLO/LibreDINOv3vitl16 with the agreement.

TRELLIS.2 出自微软研究院(microsoft/TRELLIS.2)。代码和 microsoft/TRELLIS.2-4B 权重采用 MIT 许可。

图像编码器决定了整条流水线的条款。 它是 Meta 的 facebook/dinov3-vitl16-pretrain-lvd1689m,适用 DINOv3 License。这是一份未经 OSI 批准的自定义协议,会向下传递贸易管制和最终用途限制(其中包括军事、武器、间谍和核用途)。在基于这个模型发布产品之前,请先读一遍。

权重按固定版本原样再分发,都不需要申请访问:几何网络作为 LibreYOLO/LibreTRELLIS2-4b,TRELLIS 的结构解码器和 BiRefNet(MIT)来自 LibreYOLO/LibreTRELLISl,DINOv3 编码器连同该协议作为 LibreYOLO/LibreDINOv3vitl16。nvdiffrast、nvdiffrec 和 RMBG-2.0(都是非商用)都没有使用。

引用

@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}
}

复制自作者在 github.com/microsoft/TRELLIS.2#-citation 上提供的引用块。

已针对 LibreYOLO v1.8.0 验证。本页的支持表、检查点和基准测试数据由已发布的库和权重生成,并非手工编写。