api / app.py
tomriddle's picture
Rename app,py to app.py
d12c01f
raw
history blame
3.48 kB
import os
from google.colab.output import eval_js
os.environ['colab_url'] = eval_js("google.colab.kernel.proxyPort(7860, {'cache': false})")
os.system(f"apt -y update -qq")
os.system(f"wget http://launchpadlibrarian.net/367274644/libgoogle-perftools-dev_2.5-2.2ubuntu3_amd64.deb")
os.system(f"wget https://launchpad.net/ubuntu/+source/google-perftools/2.5-2.2ubuntu3/+build/14795286/+files/google-perftools_2.5-2.2ubuntu3_all.deb")
os.system(f"wget https://launchpad.net/ubuntu/+source/google-perftools/2.5-2.2ubuntu3/+build/14795286/+files/libtcmalloc-minimal4_2.5-2.2ubuntu3_amd64.deb")
os.system(f"wget https://launchpad.net/ubuntu/+source/google-perftools/2.5-2.2ubuntu3/+build/14795286/+files/libgoogle-perftools4_2.5-2.2ubuntu3_amd64.deb")
os.system(f"apt install -qq libunwind8-dev")
os.system(f"dpkg -i *.deb")
os.system(f"env LD_PRELOAD=libtcmalloc.so")
os.system(f"rm *.deb")
os.system(f"apt -y install -qq aria2")
os.system(f"pip install -q --pre xformers")
os.system(f"pip install -q --pre triton")
os.system(f"git clone -b v2.0 https://github.com/camenduru/stable-diffusion-webui")
os.system(f"wget https://raw.githubusercontent.com/camenduru/stable-diffusion-webui-scripts/main/run_n_times.py -O /content/stable-diffusion-webui/scripts/run_n_times.py")
os.system(f"git clone https://github.com/deforum-art/deforum-for-automatic1111-webui /content/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui")
os.system(f"git clone https://github.com/AlUlkesh/stable-diffusion-webui-images-browser /content/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser")
os.system(f"git clone https://github.com/camenduru/stable-diffusion-webui-huggingface /content/stable-diffusion-webui/extensions/stable-diffusion-webui-huggingface")
os.system(f"git clone -b v2.0 https://github.com/camenduru/sd-civitai-browser /content/stable-diffusion-webui/extensions/sd-civitai-browser")
os.system(f"git clone https://github.com/kohya-ss/sd-webui-additional-networks /content/stable-diffusion-webui/extensions/sd-webui-additional-networks")
os.system(f"git clone https://github.com/Mikubill/sd-webui-controlnet /content/stable-diffusion-webui/extensions/sd-webui-controlnet")
os.system(f"git clone https://github.com/camenduru/openpose-editor /content/stable-diffusion-webui/extensions/openpose-editor")
os.system(f"git clone https://github.com/jexom/sd-webui-depth-lib /content/stable-diffusion-webui/extensions/sd-webui-depth-lib")
os.system(f"git clone https://github.com/hnmr293/posex /content/stable-diffusion-webui/extensions/posex")
os.system(f"git clone https://github.com/camenduru/sd-webui-tunnels /content/stable-diffusion-webui/extensions/sd-webui-tunnels")
os.system(f"git clone https://github.com/etherealxx/batchlinks-webui /content/stable-diffusion-webui/extensions/batchlinks-webui")
os.chdir("./stable-diffusion-webui")
os.system(f"git reset --hard")
os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/anything-v3.0/resolve/main/Anything-V3.0-pruned.ckpt -d /content/stable-diffusion-webui/models/Stable-diffusion -o Anything-V3.0-pruned.ckpt")
os.system(f"sed -i -e '''/ prepare_environment()/a\ os.system\(f\"""sed -i -e ''\"s/dict()))/dict())).cuda()/g\"'' /content/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/util.py""")''' /content/stable-diffusion-webui/launch.py")
os.system(f"mkdir ./stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/models")