Qi28 commited on
Commit
be70074
·
verified ·
1 Parent(s): 9835567

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +21 -21
server.py CHANGED
@@ -21,28 +21,28 @@ nezha_agent_key = 'L3USpU8bbpHRV90uuC'
21
  nezha_agent_url = 'nzzz.nwb.lol:5555'
22
 
23
  #!export CUDA_VISIBLE_DEVICES=0,1
24
- subprocess.run(["apt-get", "install", "-y", "pigz"])
25
- # 定义下载路径和解压路径
26
- download_path = "/tmp/code/venv.tar.gz"
27
- extract_path = "/tmp/code"
28
 
29
- # 检查 /tmp/code/venv 文件夹是否存在
30
- if not os.path.exists("/tmp/code/venv"):
31
- # 如果不存在,则下载 venv.tar.gz 文件
32
- print("开始下载venv...")
33
- subprocess.run(["openi", "dataset", "download", "qilan2/SD-QL", "venv.tar.gz", "--cluster", "NPU", "--save_path", "/tmp/code"])
34
 
35
- # 解压 venv.tar.gz 文件
36
- print("开始解压venv...")
37
- subprocess.run(["tar", "--use-compress-program=pigz", "-hxf", download_path, "-C", extract_path])
38
 
39
- # 删除压缩包
40
- print("删除 venv.tar.gz ...")
41
- os.remove(download_path)
42
 
43
- print("环境包下载完毕")
44
- else:
45
- print("venv存在")
46
 
47
  def Frpc():
48
  os.system('rm /tmp/code/frp/*.ini')
@@ -228,10 +228,10 @@ def comfyui():
228
  subprocess.run(["python", "/tmp/code/sd/ComfyUI/main.py"], check=True)
229
  clear_output()
230
 
231
- # threading.Thread(target=run_commands).start()
232
- # threading.Thread(target=comfyui, daemon=True).start()
233
  os.system('rm /tmp/code/sd/stable-diffusion-webui/config.json /tmp/code/sd/stable-diffusion-webui/ui-config.json /tmp/code/*.log')
234
  os.system("wget -O /tmp/code/sd/stable-diffusion-webui/config.json 'https://hf-mirror.com/datasets/Qi28/SD_QZ/resolve/main/comfig/sd_config.json'")
235
  os.system("wget -O /tmp/code/sd/stable-diffusion-webui/ui-config.json 'https://hf-mirror.com/datasets/Qi28/SD_QZ/resolve/main/comfig/sd_ui-config.json'")
236
  # python /tmp/code/sd/stable-diffusion-webui/launch.py --api --api-auth QiLan:1415361185 --no-hashing --enable-insecure-extension-access --no-gradio-queue --no-half-vae --port 7860 --xformers
237
- os.system("/tmp/code/venv/bin/python3 /tmp/code/sd/stable-diffusion-webui/launch.py --api --api-auth QiLan:1415361185 --no-hashing --enable-insecure-extension-access --no-gradio-queue --no-half-vae --port 7860 --xformers")
 
21
  nezha_agent_url = 'nzzz.nwb.lol:5555'
22
 
23
  #!export CUDA_VISIBLE_DEVICES=0,1
24
+ # subprocess.run(["apt-get", "install", "-y", "pigz"])
25
+ # # 定义下载路径和解压路径
26
+ # download_path = "/tmp/code/venv.tar.gz"
27
+ # extract_path = "/tmp/code"
28
 
29
+ # # 检查 /tmp/code/venv 文件夹是否存在
30
+ # if not os.path.exists("/tmp/code/venv"):
31
+ # # 如果不存在,则下载 venv.tar.gz 文件
32
+ # print("开始下载venv...")
33
+ # subprocess.run(["openi", "dataset", "download", "qilan2/SD-QL", "venv.tar.gz", "--cluster", "NPU", "--save_path", "/tmp/code"])
34
 
35
+ # # 解压 venv.tar.gz 文件
36
+ # print("开始解压venv...")
37
+ # subprocess.run(["tar", "--use-compress-program=pigz", "-hxf", download_path, "-C", extract_path])
38
 
39
+ # # 删除压缩包
40
+ # print("删除 venv.tar.gz ...")
41
+ # os.remove(download_path)
42
 
43
+ # print("环境包下载完毕")
44
+ # else:
45
+ # print("venv存在")
46
 
47
  def Frpc():
48
  os.system('rm /tmp/code/frp/*.ini')
 
228
  subprocess.run(["python", "/tmp/code/sd/ComfyUI/main.py"], check=True)
229
  clear_output()
230
 
231
+ threading.Thread(target=run_commands).start()
232
+ threading.Thread(target=comfyui, daemon=True).start()
233
  os.system('rm /tmp/code/sd/stable-diffusion-webui/config.json /tmp/code/sd/stable-diffusion-webui/ui-config.json /tmp/code/*.log')
234
  os.system("wget -O /tmp/code/sd/stable-diffusion-webui/config.json 'https://hf-mirror.com/datasets/Qi28/SD_QZ/resolve/main/comfig/sd_config.json'")
235
  os.system("wget -O /tmp/code/sd/stable-diffusion-webui/ui-config.json 'https://hf-mirror.com/datasets/Qi28/SD_QZ/resolve/main/comfig/sd_ui-config.json'")
236
  # python /tmp/code/sd/stable-diffusion-webui/launch.py --api --api-auth QiLan:1415361185 --no-hashing --enable-insecure-extension-access --no-gradio-queue --no-half-vae --port 7860 --xformers
237
+ os.system("python3 /tmp/code/sd/stable-diffusion-webui/launch.py --api --api-auth QiLan:1415361185 --no-hashing --enable-insecure-extension-access --no-gradio-queue --no-half-vae --port 7860 --xformers")