Spaces:
Runtime error
Runtime error
Download examples/img_to_mv.py from GRATITUD3/zero123plus: direct link, hf CLI and curl.
- Browser
- Download file 700 Bytes
-
https://huggingface.co/spaces/GRATITUD3/zero123plus/resolve/main/examples/img_to_mv.py
- Command line
-
hf download hf://spaces/GRATITUD3/zero123plus/examples/img_to_mv.py
-
curl -L -o img_to_mv.py https://huggingface.co/spaces/GRATITUD3/zero123plus/resolve/main/examples/img_to_mv.py
700 Bytes
| 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, num_inference_steps=75).images[0] | |
| result.show() | |
| result.save("output.png") | |