mountdrive / app.py
raylander's picture
Upload app.py
096e6be
raw
history blame
1.62 kB
import os
from subprocess import getoutput
gpu_info = getoutput('nvidia-smi')
if("A10G" in gpu_info):
os.system(f"pip install -q https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.16/xformers-0.0.16+814314d.d20230118-cp38-cp38-linux_x86_64.whl")
elif("T4" in gpu_info):
os.system(f"pip install -q https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.16/xformers-0.0.16+814314d.d20230118-cp38-cp38-linux_x86_64.whl")
# os.system(f"git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git /home/user/app/stable-diffusion-webui")
# os.chdir("/home/user/app/stable-diffusion-webui")
os.system(f"pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu116 -U")
os.system(f"pip install -q xformers==0.0.16")
os.system(f"pip install -q triton==2.0.0")
# # Clone SD WebUI from AUTOMATIC1111's repo
os.system(f"git clone https://github.com/ark5mith/stable-diffusion-webui-c")
os.system(f"ls -la")
os.chdir("stable-diffusion-webui-c")
# # Download checkpoint models to /stable-diffusion-webui/models/Stable-diffusion
#os.system(f"wget -nc -P stable-diffusion-webui-c/models/Stable-diffusion https://huggingface.co/andite/anything-v4.0/resolve/main/anything-v4.5-pruned.safetensors")
os.system(f"git reset --hard")
os.system(f"git pull")
#os.system(f"sed -i -e 's/checkout {commithash}/checkout --force {commithash}/g' launch.py")
os.system(f"python launch.py --share --xformers --enable-insecure-extension-access --theme light --skip-torch-cuda-test")
# Launch WebUI