Instructions to use Luffuly/unique3d-normal-diffuser with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Luffuly/unique3d-normal-diffuser with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Luffuly/unique3d-normal-diffuser", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
| license: mit | |
| # Unique3d-Normal-Diffuser Model Card | |
| [🌟GitHub](https://github.com/TingtingLiao/unique3d_diffuser) | [🦸 Project Page](https://wukailu.github.io/Unique3D/) | [🔋MVImage Diffuser](https://huggingface.co/Luffuly/unique3d-mvimage-diffuser) | |
|  | |
| ## Example | |
| Note the input image is suppose to be **white background**. | |
|  | |
| ```bash | |
| import torch | |
| import numpy as np | |
| from PIL import Image | |
| from pipeline import Unique3dDiffusionPipeline | |
| # opts | |
| seed = -1 | |
| generator = torch.Generator(device='cuda').manual_seed(-1) | |
| forward_args = dict( | |
| width=512, | |
| height=512, | |
| width_cond=512, | |
| height_cond=512, | |
| generator=generator, | |
| guidance_scale=1.5, | |
| num_inference_steps=30, | |
| num_images_per_prompt=1, | |
| ) | |
| # load | |
| pipe = Unique3dDiffusionPipeline.from_pretrained( | |
| "Luffuly/unique3d-normal-diffuser", | |
| torch_dtype=torch.bfloat16, | |
| trust_remote_code=True, | |
| ).to("cuda") | |
| # load image | |
| image = Image.open('image.png').convert("RGB") | |
| # forward | |
| out = pipe(image, **forward_args).images | |
| out[0].save(f"out.png") | |
| ``` | |
| ## Citation | |
| ```bash | |
| @misc{wu2024unique3d, | |
| title={Unique3D: High-Quality and Efficient 3D Mesh Generation from a Single Image}, | |
| author={Kailu Wu and Fangfu Liu and Zhihan Cai and Runjie Yan and Hanyang Wang and Yating Hu and Yueqi Duan and Kaisheng Ma}, | |
| year={2024}, | |
| eprint={2405.20343}, | |
| archivePrefix={arXiv}, | |
| primaryClass={cs.CV} | |
| } | |
| ``` |