-
Notifications
You must be signed in to change notification settings - Fork 6
Installation
Currently, MetalDiffusion can only be installed by building from source.
These installation instructions are geared towards use on an Intel Mac.
This program is best utilized within a python virtual environment, making it independent of the python already installed on MacOS.
Ventura or newer
- Terminal
- Xcode (obtained from the Apple App Store)
- Homebrew
- Pyenv
- Python, minimum version 3.9 (3.11 recommended)
- Git
Terminal will be used for all of the following commands:
Homebrew is a fundamental tool for Mac and is required for this installation process.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"brew -vIf a message like Homebrew 3.5.2 is displayed, then it's been successfully installed.
pyenv allows you to install Python independently from the Mac's base installation.
brew install pyenvIf pyenv is already installed, then Homebrew will update pyenv
pyenv install 3.9.0Set the global python that the Mac will use to the newly installed, via pyenv, python.
pyenv global 3.9.0This step will override which version and the location of python the Mac will use, allowing for easier updating and control.
Check if python was installed correctly:
python --versionIf installed correctly, Terminal will display something like Python 3.11.0
git allows you to download this repository (repo)
brew install gitIf git is already installed, then Homebrew will update git
Navigate to a folder/directory you want to create your virtual environment in. For example: /Users/MacUser
Download the repo, either by downloading the zip file or by cloning the repo with git:
git clone https://github.com/soten355/MetalDiffusion.gitFirst, navigate to the root folder in the github repo that was just installed. For example:
cd /Users/MacUser/MetalDiffusion/-
Create your virtual environment for
python:python -m venv venv
-
Activate your virtual environment:
source venv/bin/activate -
Upgrade PIP (python package manager):
pip install pip --upgrade --no-cache-dir
-
Install dependencies using the
requirements.txtfile:pip install -r requirements.txt --no-cache-dir
-
Run the program:
python dream.py
-
When finished using Stable Diffusion, deactivate the virtual environment:
deactivate
Most likely, bash commands necessary for homebrew were not executed in Terminal. Re-install homebrew and look for the specific bash commands it requires to be entered into Terminal. Those commands will be listed at the end of homebrew's installation.
Here's an example of what that command could look like for an M1 Mac:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc
source ~/.zshrcThe most likely reason is that pyenv was not installed properly. After installing pyenv, but before installing python, run this code in terminal:
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
source ~/.zshrcThis error is caused by an incorrect installation of Python through pyenv. Uninstall any python versions from pyenv and run the following code through Homebrew:
brew install openssl readline sqlite3 xz zlib tcl-tkNow re-install Python through pyenv