Update su.py
Browse files
su.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import os
|
2 |
import shutil
|
3 |
import subprocess
|
4 |
-
import modelscope
|
5 |
|
6 |
subprocess.run(["python3", "-m", "pip", "install", "--upgrade", "pip"])
|
7 |
subprocess.run(["apt", "update"])
|
@@ -10,9 +9,18 @@ subprocess.run(["apt-get", "install", "sudo"])
|
|
10 |
subprocess.run(["sudo", "apt", "install", "p7zip-full", "-y"])
|
11 |
os.system("sudo apt-get install git-lfs")
|
12 |
os.system("git lfs install")
|
13 |
-
print("stable-diffusion-webui.zip")
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
os.chdir("/mnt/workspace/stable-diffusion-webui")
|
17 |
subprocess.run([
|
18 |
"pip", "install", "-r", "requirements_versions.txt",
|
@@ -24,8 +32,8 @@ def move_files():
|
|
24 |
"/mnt/workspace/stable-diffusion-webui/点我启动SD.ipynb",
|
25 |
"/mnt/workspace/stable-diffusion-webui/下载大模型点这里.ipynb",
|
26 |
"/mnt/workspace/stable-diffusion-webui/下载Lora点这里.ipynb",
|
27 |
-
"/mnt/workspace/stable-diffusion-webui/更多服务点我",
|
28 |
"/mnt/workspace/stable-diffusion-webui/Photo",
|
|
|
29 |
]
|
30 |
destination_dir = "/mnt/workspace/"
|
31 |
for file_path in source_files:
|
|
|
1 |
import os
|
2 |
import shutil
|
3 |
import subprocess
|
|
|
4 |
|
5 |
subprocess.run(["python3", "-m", "pip", "install", "--upgrade", "pip"])
|
6 |
subprocess.run(["apt", "update"])
|
|
|
9 |
subprocess.run(["sudo", "apt", "install", "p7zip-full", "-y"])
|
10 |
os.system("sudo apt-get install git-lfs")
|
11 |
os.system("git lfs install")
|
12 |
+
print("开始下载 stable-diffusion-webui.zip")
|
13 |
+
def aria2(url, filename, d):
|
14 |
+
subprocess.run(["aria2c", "--console-log-level=error", "-c", "-x", "16", "-s", "16", url, "-o", filename, "-d", d])
|
15 |
+
url = "https://www.modelscope.cn/api/v1/models/dong625/stable-diffusion-webui/repo?Revision=master&FilePath=stable-diffusion-webui.zip"
|
16 |
+
aria2(url, "stable-diffusion-webui.zip", "/mnt/workspace")
|
17 |
+
#"https://hf-mirror.com/dong625/stable-diffusion-webui/resolve/main/stable-diffusion-webui.zip"
|
18 |
+
subprocess.run([
|
19 |
+
"7z", "x", "-pQQ917724495", "/mnt/workspace/stable-diffusion-webui.zip",
|
20 |
+
"-o/mnt/workspace", "-y"
|
21 |
+
])
|
22 |
+
os.remove("/mnt/workspace/stable-diffusion-webui.zip")
|
23 |
+
|
24 |
os.chdir("/mnt/workspace/stable-diffusion-webui")
|
25 |
subprocess.run([
|
26 |
"pip", "install", "-r", "requirements_versions.txt",
|
|
|
32 |
"/mnt/workspace/stable-diffusion-webui/点我启动SD.ipynb",
|
33 |
"/mnt/workspace/stable-diffusion-webui/下载大模型点这里.ipynb",
|
34 |
"/mnt/workspace/stable-diffusion-webui/下载Lora点这里.ipynb",
|
|
|
35 |
"/mnt/workspace/stable-diffusion-webui/Photo",
|
36 |
+
"/mnt/workspace/stable-diffusion-webui/更多服务点我",
|
37 |
]
|
38 |
destination_dir = "/mnt/workspace/"
|
39 |
for file_path in source_files:
|