Instructions to use openai/shap-e-img2img with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use openai/shap-e-img2img 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("openai/shap-e-img2img", 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
Error
when I run pip install git+https://github.com/huggingface/diffusers@@shap-ee I get this error
(shap-e) C:\Users\name>pip install git+https://github.com/huggingface/diffusers@@shap-ee
Defaulting to user installation because normal site-packages is not writeable
Collecting git+https://github.com/huggingface/diffusers@@shap-ee
Cloning https://github.com/huggingface/diffusers@ (to revision shap-ee) to c:\users\name\appdata\local\temp\pip-req-build-qzl6zef9
Running command git clone --filter=blob:none --quiet https://github.com/huggingface/diffusers@ 'C:\Users\name\AppData\Local\Temp\pip-req-build-qzl6zef9'
remote: Repository not found.
fatal: repository 'https://github.com/huggingface/diffusers@/' not found
error: subprocess-exited-with-error
Γ git clone --filter=blob:none --quiet https://github.com/huggingface/diffusers@ 'C:\Users\name\AppData\Local\Temp\pip-req-build-qzl6zef9' did not run successfully.
β exit code: 128
β°β> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
Γ git clone --filter=blob:none --quiet https://github.com/huggingface/diffusers@ 'C:\Users\name\AppData\Local\Temp\pip-req-build-qzl6zef9' did not run successfully.
β exit code: 128
β°β> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
(shap-e) C:\Users\name>