SD.Next - OSX
SD.Next was originally a fork of the Automatic1111 Stable Diffusion WebUI, but has now added so many features that is a beast in its own right. Comes with many extensions out of the box. Highly recommended implementation.
https://github.com/vladmandic/automatic
Installation is similar to Automatic1111, but I’ll include it for completeness.
Here’s step by step in terminal with comments only.
# cd into the folder where you want to install SD.Next
cd ~/sd
# Clone the repo - optionally call it something memorable - I use sdnext
git clone https://github.com/vladmandic/automatic.git sdnext
# Change into the folder where you cloned the repo
cd sdnext
# Make a virtualenv for SD.Next
pyenv virtualenv 3.10.9 sdnext
Install Pytorch Nightly for Apple Silicon
Official Apple Docs: Accelerated PyTorch Training on Mac
# Switch to the new virtualenv
pyenv shell sdnext
# Install Pytorch Nightly for Apple Silicon
# https://developer.apple.com/metal/pytorch/
pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu
Verify that Pytorch Nightly is installed correctly
python
Enter the following into the Python shell
import torch
if torch.backends.mps.is_available():
mps_device = torch.device("mps")
x = torch.ones(1, device=mps_device)
print (x)
else:
print ("MPS device not found.")
If the Pytorch Nightly for Apple Silicon is installed correctly, it will output the following:
tensor([1.], device='mps:0')
You can now exit the Python shell by pressing Ctrl-D
Start SD.Next
Now you can run SD.Next. You don’t need the first two lines if you are already in the sdnext
virtualenv and in the correct folder. But just in case you want to copy and paste these for running in the future, I’ve included them.
pyenv shell sdnext
cd ~/sd/sdnext
./webui.sh
The first time it runs, it will install a bunch of dependencies and models. Once it has started, you will be able to open it in your browser at
Questions
If you have any questions, please feel free to reach out to me on social media. For these technical things, it’s best to do it on Discord.
- My Discord username is
gymdreams
— it’s the new style without the Discriminator.
You can find my other contact info at the end of the About Me page of my main website.
Notes
These steps are verified to work for the latest commit: 81129cc when this article was published.