Update app11.py
Browse files
app11.py
CHANGED
@@ -274,15 +274,26 @@ def start():
|
|
274 |
# print(f"proxy An error occurred: {e}")
|
275 |
try:
|
276 |
#安装环境
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
os.system(f"python launch.py --api --xformers --exit --enable-insecure-extension-access --gradio-queue --disable-safe-unpickle")
|
278 |
#time.sleep(5)
|
279 |
|
280 |
command = "python launch.py --api --api-auth=123:456 --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"
|
281 |
|
282 |
notbook()
|
283 |
-
process = subprocess.Popen(command, shell=True)
|
284 |
time.sleep(200)
|
285 |
-
|
|
|
286 |
except Exception as e:
|
287 |
# 在这里处理异常的代码
|
288 |
print(f"启动SD发生错误: {e}")
|
|
|
274 |
# print(f"proxy An error occurred: {e}")
|
275 |
try:
|
276 |
#安装环境
|
277 |
+
package_envs = [
|
278 |
+
{"env": "STABLE_DIFFUSION_REPO", "url": os.environ.get('STABLE_DIFFUSION_REPO', "https://gitcode.net/overbill1683/stablediffusion")},
|
279 |
+
{"env": "STABLE_DIFFUSION_XL_REPO", "url": os.environ.get('STABLE_DIFFUSION_XL_REPO', "https://gitcode.net/overbill1683/generative-models")},
|
280 |
+
{"env": "K_DIFFUSION_REPO", "url": os.environ.get('K_DIFFUSION_REPO', "https://gitcode.net/overbill1683/k-diffusion")},
|
281 |
+
{"env": "CODEFORMER_REPO", "url": os.environ.get('CODEFORMER_REPO', "https://gitcode.net/overbill1683/CodeFormer")},
|
282 |
+
{"env": "BLIP_REPO", "url": os.environ.get('BLIP_REPO', "https://gitcode.net/overbill1683/BLIP")},
|
283 |
+
]
|
284 |
+
os.environ["PIP_INDEX_URL"] = "https://mirrors.aliyun.com/pypi/simple/"
|
285 |
+
for i in package_envs:
|
286 |
+
os.environ[i["env"]] = i["url"]
|
287 |
os.system(f"python launch.py --api --xformers --exit --enable-insecure-extension-access --gradio-queue --disable-safe-unpickle")
|
288 |
#time.sleep(5)
|
289 |
|
290 |
command = "python launch.py --api --api-auth=123:456 --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"
|
291 |
|
292 |
notbook()
|
293 |
+
#process = subprocess.Popen(command, shell=True)
|
294 |
time.sleep(200)
|
295 |
+
while True:
|
296 |
+
os.system(f"{command}")
|
297 |
except Exception as e:
|
298 |
# 在这里处理异常的代码
|
299 |
print(f"启动SD发生错误: {e}")
|