Instructions to use ModelsLab/zero123plus-v1.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ModelsLab/zero123plus-v1.1 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ModelsLab/zero123plus-v1.1", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
| license: openrail | |
| datasets: | |
| - allenai/objaverse | |
| library_name: diffusers | |
| pipeline_tag: image-to-image | |
| tags: | |
| - art | |
| Recommended version of `diffusers` is `0.20.2` with `torch` `2`. | |
| Usage Example: | |
| ```python | |
| import torch | |
| import requests | |
| from PIL import Image | |
| from diffusers import DiffusionPipeline, EulerAncestralDiscreteScheduler | |
| # Load the pipeline | |
| pipeline = DiffusionPipeline.from_pretrained( | |
| "sudo-ai/zero123plus-v1.1", custom_pipeline="sudo-ai/zero123plus-pipeline", | |
| torch_dtype=torch.float16 | |
| ) | |
| # Feel free to tune the scheduler | |
| pipeline.scheduler = EulerAncestralDiscreteScheduler.from_config( | |
| pipeline.scheduler.config, timestep_spacing='trailing' | |
| ) | |
| pipeline.to('cuda:0') | |
| # Run the pipeline | |
| cond = Image.open(requests.get("https://d.skis.ltd/nrp/sample-data/lysol.png", stream=True).raw) | |
| result = pipeline(cond).images[0] | |
| result.show() | |
| result.save("output.png") | |
| ``` | |