랭킹으로 돌아가기

deepseek-ai/DreamCraft3D

Pythonmrtornado24.github.io/DreamCraft3D/

[ICLR 2024] Official implementation of DreamCraft3D: Hierarchical 3D Generation with Bootstrapped Diffusion Prior

3d-generationaigcdiffusion-modelsgenerative-modelimage-to-3d3d-creation
스타 성장
스타
3k
포크
355
주간 성장
이슈
34
1k2k3k
2023년 10월2024년 9월2025년 8월2026년 7월
아티팩트PyPIpip install dreamcraft3d
README

DreamCraft3D

deepseek-ai%2FDreamCraft3D | Trendshift

Paper | Project Page | Youtube video | Replicate demo

Official implementation of DreamCraft3D: Hierarchical 3D Generation with Bootstrapped Diffusion Prior

Jingxiang Sun, Bo Zhang, Ruizhi Shao, Lizhen Wang, Wen Liu, Zhenda Xie, Yebin Liu

Abstract: We present DreamCraft3D, a hierarchical 3D content generation method that produces high-fidelity and coherent 3D objects. We tackle the problem by leveraging a 2D reference image to guide the stages of geometry sculpting and texture boosting. A central focus of this work is to address the consistency issue that existing works encounter. To sculpt geometries that render coherently, we perform score distillation sampling via a view-dependent diffusion model. This 3D prior, alongside several training strategies, prioritizes the geometry consistency but compromises the texture fidelity. We further propose Bootstrapped Score Distillation to specifically boost the texture. We train a personalized diffusion model, Dreambooth, on the augmented renderings of the scene, imbuing it with 3D knowledge of the scene being optimized. The score distillation from this 3D-aware diffusion prior provides view-consistent guidance for the scene. Notably, through an alternating optimization of the diffusion prior and 3D scene representation, we achieve mutually reinforcing improvements: the optimized 3D scene aids in training the scene-specific diffusion model, which offers increasingly view-consistent guidance for 3D optimization. The optimization is thus bootstrapped and leads to substantial texture boosting. With tailored 3D priors throughout the hierarchical generation, DreamCraft3D generates coherent 3D objects with photorealistic renderings, advancing the state-of-the-art in 3D content generation.

News

  • 2024.10: We release DreamCraft3D++, featuring significantly enhanced 3D generation quality and efficiency.

Method Overview

Installation

Install threestudio

This part is the same as original threestudio. Skip it if you already have installed the environment.

See installation.md for additional information, including installation via Docker.

  • You must have an NVIDIA graphics card with at least 20GB VRAM and have CUDA installed.
  • Install Python >= 3.8.
  • (Optional, Recommended) Create a virtual environment:
python3 -m virtualenv venv
. venv/bin/activate

# Newer pip versions, e.g. pip-23.x, can be much faster than old versions, e.g. pip-20.x.
# For instance, it caches the wheels of git packages to avoid unnecessarily rebuilding them later.
python3 -m pip install --upgrade pip
  • Install PyTorch >= 1.12. We have tested on torch1.12.1+cu113 and torch2.0.0+cu118, but other versions should also work fine.
# torch1.12.1+cu113
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
# or torch2.0.0+cu118
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
  • (Optional, Recommended) Install ninja to speed up the compilation of CUDA extensions:
pip install ninja
  • Install dependencies:
pip install -r requirements.txt

Download pre-trained models

  • Zero123. We use the newest stable-zero123.ckpt by default. You can download it here into load/zero123/. In the paper we use zero123-xl.ckpt and you can download it by
cd load/zero123
bash download.sh
cd load/omnidata
gdown '1Jrh-bRnJEjyMCS7f-WsaFlccfPjJPPHI&confirm=t' # omnidata_dpt_depth_v2.ckpt
gdown '1wNxVO4vVbDEMEpnAi_jwQObf2MFodcBR&confirm=t' # omnidata_dpt_normal_v2.ckpt

Quickstart

Preprocess the input image to move background and obtain its depth and normal image.

python preprocess_image.py /path/to/image.png --recenter

Our model is trained in multiple stages. You can run it by

prompt="a brightly colored mushroom growing on a log"
image_path="load/images/mushroom_log_rgba.png"

# --------- Stage 1 (NeRF & NeuS) --------- # 
python launch.py --config configs/dreamcraft3d-coarse-nerf.yaml --train system.prompt_processor.prompt="$prompt" data.image_path="$image_path"

ckpt=outputs/dreamcraft3d-coarse-nerf/$prompt@LAST/ckpts/last.ckpt
python launch.py --config configs/dreamcraft3d-coarse-neus.yaml --train system.prompt_processor.prompt="$prompt" data.image_path="$image_path" system.weights="$ckpt"

# --------- Stage 2 (Geometry Refinement) --------- # 
ckpt=outputs/dreamcraft3d-coarse-neus/$prompt@LAST/ckpts/last.ckpt
python launch.py --config configs/dreamcraft3d-geometry.yaml --train system.prompt_processor.prompt="$prompt" data.image_path="$image_path" system.geometry_convert_from="$ckpt"


# --------- Stage 3 (Texture Refinement) --------- # 
ckpt=outputs/dreamcraft3d-geometry/$prompt@LAST/ckpts/last.ckpt
python launch.py --config configs/dreamcraft3d-texture.yaml --train system.prompt_processor.prompt="$prompt" data.image_path="$image_path" system.geometry_convert_from="$ckpt"
[Optional] If the "Janus problem" arises in Stage 1, consider training a custom Text2Image model.

First, generate multi-view images from a single reference image by Zero123++.

python threestudio/scripts/img_to_mv.py --image_path 'load/mushroom.png' --save_path '.cache/temp' --prompt 'a photo of mushroom' --superres

Train a personalized DeepFloyd model by DreamBooth Lora. Please check if the generated mv images above are reasonable.

export MODEL_NAME="DeepFloyd/IF-I-XL-v1.0"
export INSTANCE_DIR=".cache/temp"
export OUTPUT_DIR=".cache/if_dreambooth_mushroom"

accelerate launch threestudio/scripts/train_dreambooth_lora.py \
  --pretrained_model_name_or_path=$MODEL_NAME  \
  --instance_data_dir=$INSTANCE_DIR \
  --output_dir=$OUTPUT_DIR \
  --instance_prompt="a sks mushroom" \
  --resolution=64 \
  --train_batch_size=4 \
  --gradient_accumulation_steps=1 \
  --learning_rate=5e-6 \
  --scale_lr \
  --max_train_steps=1200 \
  --checkpointing_steps=600 \
  --pre_compute_text_embeddings \
  --tokenizer_max_length=77 \
  --text_encoder_use_attention_mask

The personalized DeepFloyd model lora is save at .cache/if_dreambooth_mushroom. Now you can replace the guidance the training scripts by

# --------- Stage 1 (NeRF & NeuS) --------- # 
python launch.py --config configs/dreamcraft3d-coarse-nerf.yaml --train system.prompt_processor.prompt="$prompt" data.image_path="$image_path" system.guidance.lora_weights_path=".cache/if_dreambooth_mushroom"

Tips

  • Memory Usage. We run the default configs on 40G A100 GPUs. For reducing memory usage, you can reduce the rendering resolution of NeuS by data.height=128 data.width=128 data.random_camera.height=128 data.random_camera.width=128. You can also reduce resolution for other stages in the same way.

Export Meshes

You can export the textured mesh obj using the following scipt:

# this uses default mesh-exporter configurations which exports obj+mtl
python launch.py --config path/to/trial/dir/configs/parsed.yaml --export --gpu 0 resume=path/to/trial/dir/ckpts/last.ckpt system.exporter_type=mesh-exporter
Visualization of the example OBJ File.

Todo

  • Release the reorganized code.
  • Realse the test image data.
  • Clean the original dreambooth training code.
  • Provide some running results and checkpoints.

Credits

This code is built on the amazing open-source projects threestudio-project and stable-dreamfusion.

BibTeX

@article{sun2023dreamcraft3d,
  title={Dreamcraft3d: Hierarchical 3d generation with bootstrapped diffusion prior},
  author={Sun, Jingxiang and Zhang, Bo and Shao, Ruizhi and Wang, Lizhen and Liu, Wen and Xie, Zhenda and Liu, Yebin},
  journal={arXiv preprint arXiv:2310.16818},
  year={2023}
}
@article{sun2024dreamcraft3d++,
  title={DreamCraft3D++: Efficient Hierarchical 3D Generation with Multi-Plane Reconstruction Model},
  author={Sun, Jingxiang and Peng, Cheng and Shao, Ruizhi and Guo, Yuan-Chen and Zhao, Xiaochen and Li, Yangguang and Cao, Yanpei and Zhang, Bo and Liu, Yebin},
  journal={arXiv preprint arXiv:2410.12928},
  year={2024}
}
관련 저장소
Tencent-Hunyuan/Hunyuan3D-2

High-Resolution 3D Assets Generation with Large Scale Hunyuan3D Diffusion Models.

PythonPyPIOther3d3d-aigc
3d.hunyuan.tencent.com
14.3k1.5k
microsoft/TRELLIS

Official repo for paper "Structured 3D Latents for Scalable and Versatile 3D Generation" (CVPR'25 Spotlight).

PythonPyPIMIT License3d3d-generation
trellis3d.github.io
13.2k1.3k
Tencent/Hunyuan3D-2

High-Resolution 3D Assets Generation with Large Scale Hunyuan3D Diffusion Models.

PythonPyPIOther3d3d-aigc
3d.hunyuan.tencent.com
6.7k523
xxlong0/Wonder3D

Single Image to 3D using Cross-Domain Diffusion for 3D Generation

PythonPyPIMIT License3d-generation3d-aigc
xxlong.site/Wonder3D/
5.4k437
Tencent-Hunyuan/Hunyuan3D-2.1

From Images to High-Fidelity 3D Assets with Production-Ready PBR Material

PythonPyPIOther3d3d-aigc
3d.hunyuan.tencent.com
3.7k554
Tencent-Hunyuan/HunyuanWorld-1.0

Generating Immersive, Explorable, and Interactive 3D Worlds from Words or Pixels with Hunyuan3D World Model

PythonPyPIOther3d3d-generation
3d.hunyuan.tencent.com/sceneTo3D
2.9k260
wgsxm/PartCrafter

[NeurIPS 2025] PartCrafter: Structured 3D Mesh Generation via Compositional Latent Diffusion Transformers

PythonPyPIMIT License3d-generation3d-reconstruction
wgsxm.github.io/projects/partcrafter/
2.5k162
ZiYang-xie/WorldGen

🌍 WorldGen - Generate Any 3D Scene in Seconds

PythonPyPIApache License 2.03d-generation3d-reconstruction
2k194
OpenMotionLab/MotionGPT

[NeurIPS 2023] MotionGPT: Human Motion as a Foreign Language, a unified motion-language generation model using LLMs

PythonPyPIMIT License3d-generationchatgpt
motion-gpt.github.io
1.9k144
junshutang/Make-It-3D

[ICCV 2023] Make-It-3D: High-Fidelity 3D Creation from A Single Image with Diffusion Prior

PythonPyPI3d-generation3d-vision
1.9k137
VAST-AI-Research/TripoSG

TripoSG: High-Fidelity 3D Shape Synthesis using Large-Scale Rectified Flow Models

PythonPyPIMIT License3d-generation3d-reconstruction
1.7k190
One-2-3-45/One-2-3-45

[NeurIPS 2023] Official code of "One-2-3-45: Any Single Image to 3D Mesh in 45 Seconds without Per-Shape Optimization"

PythonPyPIApache License 2.03d3d-generation
one-2-3-45.com
1.7k103