Scripts to handle the cloud services I use for Stable Diffusion.
This commit is contained in:
parent
0ac6f0893d
commit
e4a7b08f8d
6 changed files with 164 additions and 0 deletions
44
stable-diffusion/setup_runpod_lora_learn.sh
Normal file
44
stable-diffusion/setup_runpod_lora_learn.sh
Normal file
|
@ -0,0 +1,44 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
apt update
|
||||
apt install -y less vim unzip zip
|
||||
|
||||
cd /workspace
|
||||
|
||||
echo "Installing dependencies"
|
||||
|
||||
pip install --upgrade \
|
||||
torch \
|
||||
torchaudio \
|
||||
torchvision \
|
||||
--index-url https://download.pytorch.org/whl/cu118
|
||||
|
||||
echo "Installing xformers"
|
||||
|
||||
pip install --no-deps xformers==0.0.17
|
||||
pip install tensorrt
|
||||
|
||||
echo "Cloning the project..."
|
||||
|
||||
git clone https://github.com/bmaltais/kohya_ss/
|
||||
|
||||
echo "Installing the project..."
|
||||
|
||||
DIR="/workspace/kohya_ss"
|
||||
TEMP_REQUIREMENTS_FILE="${DIR}/requirements_tmp_for_setup.txt"
|
||||
awk -v dir="$DIR" '/#.*kohya_ss.*library/{print; getline; sub(/^\.$/, dir)}1' "$DIR/requirements.txt" >"$TEMP_REQUIREMENTS_FILE"
|
||||
python -m pip install --use-pep517 --upgrade -r "$TEMP_REQUIREMENTS_FILE"
|
||||
|
||||
mkdir -p "$HOME/.cache/huggingface/accelerate"
|
||||
cp "${DIR}/config_files/accelerate/default_config.yaml"\
|
||||
"$HOME/.cache/huggingface/accelerate/default_config.yaml"
|
||||
|
||||
VENV_DIR=$(python -c "import site; print(site.getsitepackages()[0])")
|
||||
VENV_DIR="${VENV_DIR%/lib/python3.10/site-packages}"
|
||||
|
||||
print "Setup complete."
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue