ACCA225 commited on
Commit
0596f0c
1 Parent(s): 7e0ef7e

Update sd.py

Browse files
Files changed (1) hide show
  1. sd.py +3 -25
sd.py CHANGED
@@ -1,28 +1,4 @@
1
- import os
2
- import subprocess
3
- import subprocess
4
 
5
- # 启动Jupyter Lab
6
- subprocess.Popen([
7
- "jupyter-lab",
8
- "--no-browser",
9
- "--ip=0.0.0.0",
10
- "--allow-root",
11
- "--notebook-dir=/",
12
- "--port=8888",
13
- "--LabApp.allow_origin=*",
14
- "--LabApp.token=",
15
- "--LabApp.base_url="
16
- ])
17
- # 更新包列表并安装aria2和screen
18
- os.system("apt update && apt install -y aria2 screen")
19
-
20
- # 获取下载链接和文件保存名字
21
- download_link = input("请输入下载链接:")
22
- file_name = input("请输入文件保存名字(带后缀的):")
23
-
24
- # 使用aria2进行下载,并将文件保存到指定目录
25
- os.system(f"cd /group_share/lora-scripts/sd-models && aria2c -x 16 -s 16 -c '{download_link}' -o '{file_name}.safetensors'")
26
  import os
27
  import subprocess
28
  import subprocess
@@ -50,4 +26,6 @@ file_name = input("请输入文件保存名字(带后缀的):")
50
  os.system(f"cd /group_share/lora-scripts/sd-models && aria2c -x 16 -s 16 -c '{download_link}' -o '{file_name}.safetensors'")
51
 
52
  # 激活conda环境并运行脚本
53
- os.system("cd /group_share/xlab-app-center/stable-diffusion-webui && HF_ENDPOINT=https://hf-mirror.com /root/.conda/bin/python launch.py --api --xformers --port=7860 --no-hashing --ckpt-dir=/group_share/lora-scripts/sd-models --lora-dir=/group_share/lora-scripts/output")
 
 
 
 
 
 
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  import os
3
  import subprocess
4
  import subprocess
 
26
  os.system(f"cd /group_share/lora-scripts/sd-models && aria2c -x 16 -s 16 -c '{download_link}' -o '{file_name}.safetensors'")
27
 
28
  # 激活conda环境并运行脚本
29
+ os.system("conda activate lora")
30
+ os.system("cd /group_share/xlab-app-center/stable-diffusion-webui && HF_ENDPOINT=https://hf-mirror.com /root/.conda/bin/python launch.py --api --xformers --port=7860 --no-hashing --ckpt-dir=/group_share/lora-scripts/sd-models --lora-dir=/group_share/lora-scripts/output")
31
+