Upload install_rp.sh
Browse files- my_bak/install_rp.sh +98 -0
my_bak/install_rp.sh
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
cd /workspace
|
| 4 |
+
mkdir -p tmp
|
| 5 |
+
rm -rf README.md
|
| 6 |
+
rm -rf s
|
| 7 |
+
rm -rf ss.sh
|
| 8 |
+
|
| 9 |
+
\cp -f /workspace/SD/e /workspace/e
|
| 10 |
+
\cp -f /workspace/SD/run_rp.sh /workspace/run.sh
|
| 11 |
+
\cp -f /workspace/SD/out_rp.sh /workspace/out.sh
|
| 12 |
+
\cp -f /workspace/SD/forcePull_rp.sh /workspace/forcePull.sh
|
| 13 |
+
\cp -f /workspace/SD/gc.sh /workspace/gc.sh
|
| 14 |
+
\cp -f /workspace/SD/MyRP.ipynb /workspace/MyRP.ipynb
|
| 15 |
+
|
| 16 |
+
kill -9 $(ps -ef | grep 'relauncher.py' | grep -v 'grep' | awk '{print $2}')
|
| 17 |
+
kill -9 $(ps -ef | grep 'webui' | grep -v 'grep' | awk '{print $2}')
|
| 18 |
+
kill -9 $(ps -ef | grep 'launch.py' | grep -v 'grep' | awk '{print $2}')
|
| 19 |
+
|
| 20 |
+
rm -rf /workspace/stable-diffusion-webui
|
| 21 |
+
|
| 22 |
+
apt -y update -qq
|
| 23 |
+
apt-get install git-lfs
|
| 24 |
+
apt-get -y install rsync
|
| 25 |
+
apt-get -y install zip
|
| 26 |
+
|
| 27 |
+
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
|
| 28 |
+
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
|
| 29 |
+
git lfs install --force
|
| 30 |
+
|
| 31 |
+
if [ ! -f "/workspace/SD/extensions-builtin/forge_legacy_preprocessors/annotator/oneformer/oneformer/data/bpe_simple_vocab_16e6.txt.gz" ]; then
|
| 32 |
+
cd /workspace/SD
|
| 33 |
+
git gc
|
| 34 |
+
cd /workspace/SD/extensions-builtin/forge_legacy_preprocessors/annotator/oneformer/oneformer/data
|
| 35 |
+
curl -L -O https://huggingface.co/zuv0/test/resolve/main/bpe_simple_vocab_16e6.txt.gz
|
| 36 |
+
fi
|
| 37 |
+
|
| 38 |
+
if [ ! -d "/workspace/SD/modelas" ]; then
|
| 39 |
+
cd /workspace/SD
|
| 40 |
+
git clone https://huggingface.co/zuv0/modelsXL models
|
| 41 |
+
\mv -f /workspace/SD/repositories/BLIP/_git /workspace/SD/repositories/BLIP/.git
|
| 42 |
+
\mv -f /workspace/SD/repositories/generative-models/_git /workspace/SD/repositories/generative-models/.git
|
| 43 |
+
\mv -f /workspace/SD/repositories/k-diffusion/_git /workspace/SD/repositories/k-diffusion/.git
|
| 44 |
+
\mv -f /workspace/SD/repositories/stable-diffusion-stability-ai/_git /workspace/SD/repositories/stable-diffusion-stability-ai/.git
|
| 45 |
+
\mv -f /workspace/SD/repositories/stable-diffusion-webui-assets/_git /workspace/SD/repositories/stable-diffusion-webui-assets/.git
|
| 46 |
+
fi
|
| 47 |
+
|
| 48 |
+
cd /workspace/SD/models
|
| 49 |
+
git fetch --all
|
| 50 |
+
git reset --hard origin/main
|
| 51 |
+
git pull
|
| 52 |
+
rsync -r "embeddings/" "../embeddings/"
|
| 53 |
+
git repack -a -d --depth=250 --window=250
|
| 54 |
+
cd .git
|
| 55 |
+
rm -rf lfs
|
| 56 |
+
|
| 57 |
+
cd /workspace/SD
|
| 58 |
+
sh downs.sh $1 0
|
| 59 |
+
|
| 60 |
+
cd /workspace/SD
|
| 61 |
+
|
| 62 |
+
pip3 install pcloud
|
| 63 |
+
pip uninstall -y setuptools
|
| 64 |
+
pip install setuptools==69.5.1
|
| 65 |
+
pip uninstall -y matplotlib
|
| 66 |
+
pip install matplotlib==3.8.4
|
| 67 |
+
pip uninstall -y xformers
|
| 68 |
+
pip uninstall -y torchaudio
|
| 69 |
+
pip install torch==2.3.0 torchvision --index-url https://download.pytorch.org/whl/cu121
|
| 70 |
+
pip3 install -r requirements_versions.txt --extra-index-url https://download.pytorch.org/whl/cu121
|
| 71 |
+
pip3 install -r extensions-builtin/sd_forge_controlnet/requirements.txt
|
| 72 |
+
pip3 install -r extensions-builtin/forge_legacy_preprocessors/requirements.txt
|
| 73 |
+
#pip3 install insightface
|
| 74 |
+
pip3 uninstall -y onnxruntime
|
| 75 |
+
pip3 install onnxruntime-gpu
|
| 76 |
+
pip install pydantic==1.10.11
|
| 77 |
+
#apt install libgl1 -yq
|
| 78 |
+
apt-get install -y libgl1-mesa-glx
|
| 79 |
+
#apt -y install -qq aria2 libcairo2-dev pkg-config python3-dev
|
| 80 |
+
python3 -c "from launch import prepare_environment; prepare_environment()" --skip-torch-cuda-test
|
| 81 |
+
|
| 82 |
+
cd /workspace
|
| 83 |
+
|
| 84 |
+
python3 /workspace/SD/launch.py --no-download-sd-model --exit
|
| 85 |
+
|
| 86 |
+
apt-get clean
|
| 87 |
+
pip cache purge
|
| 88 |
+
|
| 89 |
+
kill -9 $(ps -ef | grep 'relauncher.py' | grep -v 'grep' | awk '{print $2}')
|
| 90 |
+
kill -9 $(ps -ef | grep 'webui' | grep -v 'grep' | awk '{print $2}')
|
| 91 |
+
kill -9 $(ps -ef | grep 'launch.py' | grep -v 'grep' | awk '{print $2}')
|
| 92 |
+
|
| 93 |
+
rm -rf /workspace/stable-diffusion-webui
|
| 94 |
+
cd /workspace
|
| 95 |
+
|
| 96 |
+
echo " -----===== =====----- "
|
| 97 |
+
echo " Install Done."
|
| 98 |
+
echo " -----===== =====----- "
|