3DTopia-XL

3DTopiaApache-2.0长期未更新

用图生文生方式生成带 PBR 材质的高质量 3D 资产,基于 Primitive Diffusion 把 3D 生成拆成可扩展的图元扩散过程。

[CVPR 2025 Highlight] 3DTopia-XL: High-Quality 3D PBR Asset Generation via Primitive Diffusion

暂无版本1,050star40fork同步于 2026-11-07 07:32 UTC

怎么上手

由 README 提炼,执行前请确认
conda create -n primx python=3.9
conda install pytorch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 pytorch-cuda=11.8 -c pytorch -c nvidia
pip install -r requirements.txt
bash install.sh
python inference.py ./configs/inference_dit.yml
硬件要求按 README 说明

README 未明确给出显存要求;安装命令指定 pytorch-cuda=11.8,说明推理依赖 NVIDIA GPU 与 CUDA 环境,未提及 CPU 运行或 AMD 等其他厂商支持。

支持 Apple Silicon
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

基于图元扩散的 3D 生成模型,从单图或文本生成带 PBR 材质的高质量三维资产

用图生文生方式生成带 PBR 材质的高质量 3D 资产,基于 Primitive Diffusion 把 3D 生成拆成可扩展的图元扩散过程。

核心能力

  • 用图元表示配合扩散 Transformer 生成三维资产
  • 同时输出平滑几何与 PBR 材质并导出 GLB
  • 支持单图条件与文本条件两条生成管线
  • 提供 Gradio 界面与 CLI 配置化推理
  • 开放 VAE 与 DiT 训练代码及数据拟合流程

容易踩的坑

需先手动下载 DiT 与 VAE 权重到 pretrained 目录,文本模型权重还需从 Google Drive 单独获取;依赖 xformers 与第三方库编译脚本 install.sh;旧版 Trimesh 需手动修复 specular_to_pbr 的贴图打包 bug。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Paper | Project Page | Video | Weights | Hugging Face :hugs: | WiseModel

    News

    [02/2025] 3DTopia-XL is accepted to CVPR 2025 :fire:

    [02/2025] Training code released!

    [10/2024] WiseModel demo released!

    [09/2024] Technical report released! arXiv

    [09/2024] Hugging Face demo released! demo

    [09/2024] Inference code released!

    Citation

    If you find our work useful for your research, please consider citing this paper:

    @inproceedings{chen2025primx,
      title={3DTopia-XL: High-Quality 3D PBR Asset Generation via Primitive Diffusion},
      author={Chen, Zhaoxi and Tang, Jiaxiang and Dong, Yuhao and Cao, Ziang and Hong, Fangzhou and Lan, Yushi and Wang, Tengfei and Xie, Haozhe and Wu, Tong and Saito, Shunsuke and Pan, Liang and Lin, Dahua and Liu, Ziwei},
      booktitle={CVPR},
      year={2025}
    }
    

    :gear: Installation

    We highly recommend using Anaconda to manage your python environment. You can setup the required environment by the following commands:

    # install dependencies
    conda create -n primx python=3.9
    conda install pytorch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 pytorch-cuda=11.8 -c pytorch -c nvidia
    # requires xformer for efficient attention
    conda install xformers::xformers
    # install other dependencies
    pip install -r requirements.txt
    # compile third party libraries
    bash install.sh
    # Now, all done!
    

    For proper glTF texture and material packing, fix a bug in Trimesh (trimesh.visual.gloss.specular_to_pbr #L361) if you are using old version:

        result["metallicRoughnessTexture"] = toPIL(
            np.concatenate(
                [np.zeros_like(metallic), 1.0 - glossiness, metallic], axis=-1
            ),
            mode="RGB",
        )
    

    :muscle: Pretrained Weights

    Our pretrained weight can be downloaded from huggingface

    For example, to download the singleview-conditioned model in fp16 precision for inference:

    mkdir pretrained && cd pretrained
    # download DiT
    wget https://huggingface.co/FrozenBurning/3DTopia-XL/resolve/main/model_sview_dit_fp16.pt
    # download VAE
    wget https://huggingface.co/FrozenBurning/3DTopia-XL/resolve/main/model_vae_fp16.pt
    cd ..
    

    For text-conditioned model, please download from this Google Drive We put out text conditioner in models/conditioner/text.py. Please download the specific version of text conditioner as follows:

    cd pretrained
    wget https://huggingface.co/laion/CLIP-ViT-L-14-DataComp.XL-s13B-b90K/resolve/main/open_clip_pytorch_model.bin\?download\=true
    cd ..
    

    :rocket: Inference

    Gradio Demo

    The gradio demo will automatically download pretrained weights using huggingface_hub.

    You could locally launch our demo with Gradio UI by:

    python app.py
    

    Alternatively, you can run the demo online Open in Spaces

    CLI Test

    Run the following command for inference:

    python inference.py ./configs/inference_dit.yml
    

    Furthermore, you can modify the inference parameters in inference_dit.yml, detailed as follows:

    ParameterRecommendedDescription
    input_dir-The path of folder that stores all input images.
    ddim25, 50, 100Total number of DDIM steps. Robust with more steps but fast with fewer steps.
    cfg4 - 7The scale for Classifer-free Guidance (CFG).
    seedAnyDifferent seeds lead to diverse different results.
    export_glbTrueWhether to export textured mesh in GLB format after DDIM sampling is over.
    fast_unwrapFalseWhether to enable fast UV unwrapping algorithm.
    decimate100000The max number of faces for mesh extraction.
    mc_resolution256The resolution of the unit cube for marching cube.
    remeshFalseWhether to run retopology after mesh extraction.

    By changing the config to inference_dit_text.yml and update the image encoding process to text encoding in the inference script, you will get the text-to-3D generation pipeline.

    :hotsprings: Training

    Data Preparation and Mesh2PrimX

    Raw data: Textured Mesh

    We train our model on a subset of Objaverse dataset. Please refer to the list where each entry is stored as {folder}/{uid}.

    Raw data: Captions

    Our captions can be downloaded from this Google Drive.

    Tensorize meshes into PrimX

    The first step before training is to converting all textured meshes (glTF format) into PrimX representation (NxD tensor):

    # this only fit one single mesh defined as dataset.mesh_file_path
    python train_fitting.py configs/train_fitting.yml
    

    The above command only fit a single textured mesh whose path is defined as dataset.mesh_file_path in the config file. It can be easily scaled up to the fullset with a parallel fitting pipeline.

    The following comparisons illustrate the quality of high-quality tokenization by PrimX:

    VAE Training

    To train the VAE for Primitive Patch Compression, run the following command:

    torchrun --nnodes=1 --nproc_per_node=8 train_vae.py configs/train_vae.yml
    

    By default, the VAE training relies on PrimX fittings from previous stage whose path template is defined as dataset.manifold_url_template in the config file.

    DiT Training

    Before the DiT training, we suggest to cache all condition features and VAE features:

    # vae cache, which will use the vae checkpoint as model.vae_checkpoint_path
    python scripts/cache_vae.py configs/train_dit.yml
    # condition cache
    python scripts/cache_conditioner.py configs/train_dit.yml
    

    Once caching is done, training DiT for conditional 3D generation can be launched as follows:

    torchrun --nnodes=1 --nproc_per_node=8 train_dit.py configs/train_dit.yml
    

    Acknowledgement

    This work is built on many amazing research works and open-source projects, thanks all the authors for sharing!