Instructions to use kumarhans/multi_view_sample with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use kumarhans/multi_view_sample with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("kumarhans/multi_view_sample", 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
| import torch | |
| import kiui | |
| import numpy as np | |
| import argparse | |
| from mvdream.pipeline_mvdream import MVDreamStableDiffusionPipeline | |
| pipe = MVDreamStableDiffusionPipeline.from_pretrained( | |
| "./weights", # local weights | |
| # "ashawkey/mvdream-sd2.1-diffusers", | |
| torch_dtype=torch.float16 | |
| ) | |
| pipe = pipe.to("cuda") | |
| parser = argparse.ArgumentParser(description="MVDream") | |
| parser.add_argument("prompt", type=str, default="a cute owl 3d model") | |
| args = parser.parse_args() | |
| while True: | |
| image = pipe(args.prompt) | |
| grid = np.concatenate( | |
| [ | |
| np.concatenate([image[0], image[2]], axis=0), | |
| np.concatenate([image[1], image[3]], axis=0), | |
| ], | |
| axis=1, | |
| ) | |
| kiui.vis.plot_image(grid) | |