camenduru multimodalart HF staff commited on
Commit
0b0d8a3
1 Parent(s): 4c3cb76

Check GPU to attribute the right xformers (#7)

Browse files

- Check GPU to attribute the right xformers (0b07795d5c1011c05517f8a8bfa7fc11d9f90ca0)


Co-authored-by: Multimodal AI art <[email protected]>

Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -1,5 +1,12 @@
1
  import os
2
- os.system(f"pip install -q https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.15/xformers-0.0.15.dev0+1515f77.d20221130-cp38-cp38-linux_x86_64.whl")
 
 
 
 
 
 
 
3
  os.system(f"git clone -b queue https://github.com/camenduru/stable-diffusion-webui /home/user/app/stable-diffusion-webui")
4
  os.system(f"wget -q https://huggingface.co/Linaqruf/anything-v3.0/resolve/main/Anything-V3.0-pruned.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/Anything-V3.0-pruned.ckpt")
5
  os.system(f"wget -q https://huggingface.co/Linaqruf/anything-v3.0/resolve/main/Anything-V3.0.vae.pt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/Anything-V3.0-pruned.vae.pt")
 
1
  import os
2
+ from subprocess import getoutput
3
+ gpu_info = getoutput('nvidia-smi')
4
+ if("A10G" in gpu_info):
5
+ print("Using A10G")
6
+ os.system(f"pip install -q https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.15/xformers-0.0.15.dev0+4c06c79.d20221205-cp38-cp38-linux_x86_64.whl")
7
+ elif("T4" in gpu_info):
8
+ print("Using T4")
9
+ os.system(f"pip install -q https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.15/xformers-0.0.15.dev0+1515f77.d20221130-cp38-cp38-linux_x86_64.whl")
10
  os.system(f"git clone -b queue https://github.com/camenduru/stable-diffusion-webui /home/user/app/stable-diffusion-webui")
11
  os.system(f"wget -q https://huggingface.co/Linaqruf/anything-v3.0/resolve/main/Anything-V3.0-pruned.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/Anything-V3.0-pruned.ckpt")
12
  os.system(f"wget -q https://huggingface.co/Linaqruf/anything-v3.0/resolve/main/Anything-V3.0.vae.pt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/Anything-V3.0-pruned.vae.pt")