ACCA225 commited on
Commit
106385e
1 Parent(s): 44d287e

Update app11.py

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