Update app11.py
Browse files
app11.py
CHANGED
@@ -21,7 +21,7 @@ import subprocess
|
|
21 |
def notbook():
|
22 |
os.system("pip install jupyterlab")
|
23 |
# 构建命令字符串
|
24 |
-
ngrok_command = f"ngrok
|
25 |
jupyter_command = "jupyter-lab --no-browser --ip=0.0.0.0 --allow-root --notebook-dir=/ --port=8889 --LabApp.token= --LabApp.allow_origin=* --LabApp.base_url="
|
26 |
|
27 |
# 启动 ngrok 进程
|
@@ -29,12 +29,14 @@ def notbook():
|
|
29 |
|
30 |
# 启动 Jupyter 进程
|
31 |
jupyter_process = subprocess.Popen(jupyter_command, shell=True)
|
32 |
-
|
|
|
33 |
os.system("pip install nvidia-ml-py3")
|
34 |
os.chdir(f"/home/xlab-app-center")
|
35 |
os.system(f"git clone https://openi.pcl.ac.cn/2575044704/sd-v1.7.0 /home/xlab-app-center/stable-diffusion-webui")
|
36 |
os.system(f"cp /home/xlab-app-center/styles.csv /home/xlab-app-center/stable-diffusion-webui/styles.csv")
|
37 |
os.chdir(f"/home/xlab-app-center/stable-diffusion-webui")
|
|
|
38 |
os.system(f"git lfs install")
|
39 |
os.system(f"git reset --hard")
|
40 |
os.chdir(f"/home/xlab-app-center/stable-diffusion-webui/extensions")
|
@@ -248,7 +250,7 @@ def start():
|
|
248 |
#notbook()
|
249 |
process = subprocess.Popen(command, shell=True)
|
250 |
time.sleep(200)
|
251 |
-
os.system(f"{command} --port=7861 --ngrok=2KPyfzQrHit97J02tARy1ckHJYd_69rJbgjpjnVVeuXD3j9tv ")
|
252 |
except Exception as e:
|
253 |
# 在这里处理异常的代码
|
254 |
print(f"启动SD发生错误: {e}")
|
|
|
21 |
def notbook():
|
22 |
os.system("pip install jupyterlab")
|
23 |
# 构建命令字符串
|
24 |
+
ngrok_command = f"ngrok http 8889 --authtoken=2KPyfzQrHit97J02tARy1ckHJYd_69rJbgjpjnVVeuXD3j9tv"
|
25 |
jupyter_command = "jupyter-lab --no-browser --ip=0.0.0.0 --allow-root --notebook-dir=/ --port=8889 --LabApp.token= --LabApp.allow_origin=* --LabApp.base_url="
|
26 |
|
27 |
# 启动 ngrok 进程
|
|
|
29 |
|
30 |
# 启动 Jupyter 进程
|
31 |
jupyter_process = subprocess.Popen(jupyter_command, shell=True)
|
32 |
+
#os.system(f"ngrok tunnel --authtoken={ngrok_token} --region=ap http://localhost:8888 & python jupyter-lab --ServerApp.shutdown_no_activity_timeout=1800 --TerminalManager.cull_inactive_timeout=1800 --TerminalManager.cull_interval=300 --MappingKernelManager.cull_idle_timeout=1800 --MappingKernelManager.cull_interval=300 --MappingKernelManager.cull_connected=True --MappingKernelManager.cull_busy=True --no-browser --ip=0.0.0.0 --allow-root --notebook-dir=/ --port=8888 --LabApp.token= --LabApp.allow_origin=* --LabApp.base_url=")
|
33 |
+
|
34 |
os.system("pip install nvidia-ml-py3")
|
35 |
os.chdir(f"/home/xlab-app-center")
|
36 |
os.system(f"git clone https://openi.pcl.ac.cn/2575044704/sd-v1.7.0 /home/xlab-app-center/stable-diffusion-webui")
|
37 |
os.system(f"cp /home/xlab-app-center/styles.csv /home/xlab-app-center/stable-diffusion-webui/styles.csv")
|
38 |
os.chdir(f"/home/xlab-app-center/stable-diffusion-webui")
|
39 |
+
os.system("wget https://openi.pcl.ac.cn/2575044704/stable-diffusion-webui2/raw/branch/master/webui.py -O webui.py")
|
40 |
os.system(f"git lfs install")
|
41 |
os.system(f"git reset --hard")
|
42 |
os.chdir(f"/home/xlab-app-center/stable-diffusion-webui/extensions")
|
|
|
250 |
#notbook()
|
251 |
process = subprocess.Popen(command, shell=True)
|
252 |
time.sleep(200)
|
253 |
+
#os.system(f"{command} --port=7861 --ngrok=2KPyfzQrHit97J02tARy1ckHJYd_69rJbgjpjnVVeuXD3j9tv ")
|
254 |
except Exception as e:
|
255 |
# 在这里处理异常的代码
|
256 |
print(f"启动SD发生错误: {e}")
|