Stable Diffusion

Saved some notes from here on how to run this on my Mac (a MacBook Pro 16-inch, 2021, M1 Max, 32GB RAM).

I needed Python 3.10; using the 3.11 (beta) version didn’t work. Got a bunch of OpenBLAS-related compilation errors. I just used pyenv to create a virtual environment.

brew update
brew install Cmake protobuf rust

pyenv virtualenv stable-diffusion
pyenv activate stable-diffusion

git clone -b apple-silicon-mps-support
cd stable-diffusion
pip install -r requirements.txt

# Download sd-v1-4.ckpt from here
# and place it in this folder as
#    models/ldm/stable-diffusion-v1/model.ckpt
mkdir -p models/ldm/stable-diffusion-v1/

# Run!
python scripts/ \
    --prompt "a red juicy apple floating in outer space, like a planet" \
    --n_samples 1 --n_iter 1 --plms

# Results will be here
ls -l outputs/txt2img-samples/


Here’s a nice basic overview of diffusion. This video goes a bit more into depth.


I found two web UIs that might work well.