File size: 1,617 Bytes
8d1ad8a
 
 
 
 
 
 
 
 
 
 
 
 
096e6be
 
 
8d1ad8a
 
abfaf73
9409882
abfaf73
8d1ad8a
096e6be
f1f5f29
8d1ad8a
f1f5f29
 
8c6e1ae
8d1ad8a
f1f5f29
8d1ad8a
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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