Instructions to use CompVis/stable-diffusion-v1-4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use CompVis/stable-diffusion-v1-4 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", dtype=torch.bfloat16, device_map="cuda") prompt = "A high tech solarpunk utopia in the Amazon rainforest" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
GPU based StableDiffusion in python is not working in MAC
"venv/lib/python3.9/site-packages/torch/cuda/init.py", line 221, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
system_profiler SPDisplaysDataType | grep "NVIDIA" returns empty basically mac doesn't have NVIDIA based GPU, how to overcome this limitation in mac
Recent update : i tried to use CPU instead of GPU, still i have issues, Can you suggest me a right revision to test with cpu or suggest some solution for this.
"RuntimeError: "LayerNormKernelImpl" not implemented for 'Half'"
Hi @muralimanohar ! Macs don't have CUDA support (unless in rare cases with external GPUs attached to the computer). If you have an M1/M2 computer, then you can use the mps device for hardware acceleration, as described here: https://huggingface.co/docs/diffusers/optimization/mps
Hope that helps!