Last active
February 19, 2025 03:17
-
-
Save jstayco/9f5733f05b9dc29de95c4056a023d645 to your computer and use it in GitHub Desktop.
Setup script for Kohya SS on macOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # The initial setup script to prep the environment on macOS | |
| # xformers has been omitted as that is for Nvidia GPUs only | |
| if ! command -v brew >/dev/null; then | |
| echo "Please install homebrew first. This is a requirement for the remaining setup." | |
| echo "You can find that here: https://brew.sh" | |
| exit 1 | |
| fi | |
| # Install base python packages | |
| echo "Installing Python 3.10 if not found." | |
| brew ls --versions python@3.10 >/dev/null || brew install python@3.10 | |
| echo "Installing Python-TK 3.10 if not found." | |
| brew ls --versions python-tk@3.10 >/dev/null || brew install python-tk@3.10 | |
| if command -v python3.10 >/dev/null; then | |
| python3.10 -m venv venv | |
| source venv/bin/activate | |
| # DEBUG ONLY | |
| #pip install pydevd-pycharm~=223.8836.43 | |
| # Tensorflow installation | |
| if wget https://github.com/apple/tensorflow_macos/releases/download/v0.1alpha3/tensorflow_macos-0.1a3-cp38-cp38-macosx_11_0_arm64.whl /tmp; then | |
| python -m pip install tensorflow==0.1a3 -f https://github.com/apple/tensorflow_macos/releases/download/v0.1alpha3/tensorflow_macos-0.1a3-cp38-cp38-macosx_11_0_arm64.whl | |
| rm -f /tmp/tensorflow_macos-0.1a3-cp38-cp38-macosx_11_0_arm64.whl | |
| fi | |
| pip install torch==2.0.0 torchvision==0.15.1 -f https://download.pytorch.org/whl/cpu/torch_stable.html | |
| python -m pip install --use-pep517 --upgrade -r requirements.txt | |
| accelerate config | |
| echo -e "Setup finished! Run ./gui.sh to start." | |
| else | |
| echo "Python not found. Please ensure you install Python." | |
| echo "The brew command for Python 3.10 is: brew install python@3.10" | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| accelerate==0.15.0 | |
| albumentations==1.3.0 | |
| altair==4.2.2 | |
| bitsandbytes==0.35.0 | |
| dadaptation==1.5 | |
| diffusers[torch]==0.10.2 | |
| easygui==0.98.3 | |
| einops==0.6.0 | |
| ftfy==6.1.1 | |
| gradio==3.19.1; sys_platform != 'darwin' | |
| gradio==3.23.0; sys_platform == 'darwin' | |
| lion-pytorch==0.0.6 | |
| opencv-python==4.7.0.68 | |
| pytorch-lightning==1.9.0 | |
| safetensors==0.2.6 | |
| tensorboard==2.10.1 | |
| tk==0.1.0 | |
| toml==0.10.2 | |
| transformers==4.26.0 | |
| voluptuous==0.13.1 | |
| # for BLIP captioning | |
| fairscale==0.4.13 | |
| requests==2.28.2 | |
| timm==0.6.12 | |
| # tensorflow<2.11 | |
| huggingface-hub==0.12.0; sys_platform != 'darwin' | |
| huggingface-hub==0.13.0; sys_platform == 'darwin' | |
| tensorflow==2.10.1; sys_platform != 'darwin' | |
| # For locon support | |
| lycoris_lora==0.1.2 | |
| # for kohya_ss library | |
| . |
Author
Apologies, this is now out dated. There is a setup.sh that you should run in the main repo that is better than this script. https://github.com/bmaltais/kohya_ss
the setup.sh works but clicking on folders in folder tab doesnt do anything, seems useless for Mac
it's no big deal. you can copy/paste the path of your folders in it
setup still doesnt work using gui, I created my own branch from kohya_ss which works with MPS , however I just run the script not the gui but it works with GPU acceleration. and followed this after: https://hackmd.io/@cy2023/r1_sKqlg3
https://github.com/retret66/sd-scripts
uh?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the help on this, question I have:
1. how do I patch the files.
2. where do I run this command that doesn't work:
kohya_ss % bash ./macos.sh
bash: ./macos.sh: No such file or directory