Spaces:
Runtime error
Runtime error
Upload 2 files
Browse files
README.md
CHANGED
@@ -1,12 +1,11 @@
|
|
1 |
---
|
2 |
title: Mountdrive
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 3.
|
8 |
app_file: app.py
|
9 |
-
pinned:
|
|
|
10 |
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
title: Mountdrive
|
3 |
+
emoji: π
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: blue
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 3.9
|
8 |
app_file: app.py
|
9 |
+
pinned: true
|
10 |
+
duplicated_from:
|
11 |
---
|
|
|
|
app.py
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from subprocess import getoutput
|
3 |
+
|
4 |
+
gpu_info = getoutput('nvidia-smi')
|
5 |
+
if("A10G" in gpu_info):
|
6 |
+
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")
|
7 |
+
elif("T4" in gpu_info):
|
8 |
+
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")
|
9 |
+
|
10 |
+
# os.system(f"git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git /home/user/app/stable-diffusion-webui")
|
11 |
+
|
12 |
+
# os.chdir("/home/user/app/stable-diffusion-webui")
|
13 |
+
|
14 |
+
# Mount our drive
|
15 |
+
from google.colab import drive
|
16 |
+
drive.mount('/content/drive')
|
17 |
+
|
18 |
+
# Create a folder for storing files
|
19 |
+
os.system(f"mkdir sd-webui-files")
|
20 |
+
os.chdir("sd-webui-files")
|
21 |
+
|
22 |
+
# # Clone SD WebUI from AUTOMATIC1111's repo
|
23 |
+
# os.system(f"git clone --depth=1 https://github.com/AUTOMATIC1111/stable-diffusion-webui.git sd-webui-files/stable-diffusion-webui")
|
24 |
+
|
25 |
+
# # Download checkpoint models to /stable-diffusion-webui/models/Stable-diffusion
|
26 |
+
# !wget -nc -P /content/drive/MyDrive/sd-webui-files/stable-diffusion-webui/models/Stable-diffusion https://huggingface.co/andite/anything-v4.0/resolve/main/anything-v4.5-pruned.safetensors
|
27 |
+
|
28 |
+
# # Fix change branch issues
|
29 |
+
# %cd /content/drive/MyDrive/sd-webui-files/stable-diffusion-webui/
|
30 |
+
# !git reset --hard
|
31 |
+
# !git pull
|
32 |
+
# !sed -i -e 's/checkout {commithash}/checkout --force {commithash}/g' launch.py
|
33 |
+
|
34 |
+
# Launch WebUI
|
35 |
+
|