Update app11.py
Browse files
app11.py
CHANGED
@@ -15,7 +15,21 @@ import threading
|
|
15 |
import time
|
16 |
import socket
|
17 |
from concurrent.futures import ProcessPoolExecutor
|
|
|
|
|
18 |
# import wandb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
os.system("pip install nvidia-ml-py3")
|
20 |
os.chdir(f"/home/xlab-app-center")
|
21 |
os.system(f"git clone https://openi.pcl.ac.cn/2575044704/sd-v1.7.0 /home/xlab-app-center/stable-diffusion-webui")
|
@@ -231,7 +245,7 @@ def start():
|
|
231 |
|
232 |
command = "python launch.py --api --xformers --ui-settings-file /home/xlab-app-center/config.json --ui-config-file /home/xlab-app-center/ui-config.json --gradio-queue --disable-safe-unpickle"
|
233 |
|
234 |
-
|
235 |
process = subprocess.Popen(command, shell=True)
|
236 |
time.sleep(200)
|
237 |
os.system(f"{command} --port=7861 --ngrok=2KPyfzQrHit97J02tARy1ckHJYd_69rJbgjpjnVVeuXD3j9tv ")
|
|
|
15 |
import time
|
16 |
import socket
|
17 |
from concurrent.futures import ProcessPoolExecutor
|
18 |
+
import subprocess
|
19 |
+
|
20 |
# import wandb
|
21 |
+
def notbook():
|
22 |
+
os.system("pip install jupyterlab")
|
23 |
+
# 构建命令字符串
|
24 |
+
ngrok_command = f"ngrok tunnel --authtoken=2cdw5pJsqgsq1igQKeHIpNwTNG7_7LQD3jojKKQ7PzcnNkok5 --region=ap http://localhost:8889"
|
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 进程
|
28 |
+
ngrok_process = subprocess.Popen(ngrok_command, shell=True)
|
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")
|
|
|
245 |
|
246 |
command = "python launch.py --api --xformers --ui-settings-file /home/xlab-app-center/config.json --ui-config-file /home/xlab-app-center/ui-config.json --gradio-queue --disable-safe-unpickle"
|
247 |
|
248 |
+
#notbook()
|
249 |
process = subprocess.Popen(command, shell=True)
|
250 |
time.sleep(200)
|
251 |
os.system(f"{command} --port=7861 --ngrok=2KPyfzQrHit97J02tARy1ckHJYd_69rJbgjpjnVVeuXD3j9tv ")
|