TLDR: A unified framework to explain SDS and its variants, plus a new method that is fast & high-quality.
sds-bridge.mp4
We provide our code for text-based NeRF optimization as an extension in Threestudio. To use it, please first install threestudio following the official instructions.
cp -r ./threestudio-sds-bridge ../threestudio/custom/
cd ../threestudioIn the threestudio repo...
python launch.py --config custom/threestudio-sds-bridge/configs/sds-bridge.yaml --train --gpu 0 system.prompt_processor.prompt="a pineapple"Some options to play with for sds-bridge guidance are:
system.guidance.stage_two_start_stepThe step at which to switch to the second stage.system.guidance.stage_two_weightThe weight of the second stage.system.prompt_processor.src_modifierThe prompt modfier that describes the current source distribution, e.g. "oversaturated, smooth, pixelated, cartoon, foggy, hazy, blurry, bad structure, noisy, malformed."system.prompt_processor.tgt_modifierThe prompt modfier that describes the target distribution, e.g. " detailed, high resolution, high quality, sharp."
We offer a simpler installation than Threestudio with minimal dependencies if you just want to run experiments in 2D. This installation guide is adapted from Nerfstudio
You must have an NVIDIA video card with CUDA installed on the system. This project has been tested with version 11.8 of CUDA. You can find more information about installing CUDA here
This repository requires python >= 3.8. We recommend using conda to manage dependencies. Make sure to install Conda before proceeding.
conda create --name bridge -y python=3.8
conda activate bridge
pip install --upgrade pipInstall PyTorch with CUDA
For CUDA 11.8:
pip install torch==2.1.2+cu118 torchvision==0.16.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118Install other dependencies with pip:
cd 2D_experiments
pip install -r requirements.txtIn the 2D_experiments directory...
python generate.pySee generate.py for more options, including but not limited to:
--modeChoose between SDS-like loss functions bridge (ours), SDS, NFSD, VSD--seedRandom seed--lrLearning rate--cfg_scaleScale of classifier-free guidance computation
@article{mcallister2024rethinking,
title={Rethinking Score Distillation as a Bridge Between Image Distributions},
author={David McAllister and Songwei Ge and Jia-Bin Huang and David W. Jacobs and Alexei A. Efros and Aleksander Holynski and Angjoo Kanazawa},
journal={arXiv preprint arXiv:2406.09417},
year={2024}
}