ACCA225 commited on
Commit
9b4d7fc
1 Parent(s): daa5f8b

Update new.py

Browse files
Files changed (1) hide show
  1. new.py +7 -0
new.py CHANGED
@@ -116,6 +116,12 @@ def download_extensions(extensions):
116
  def model_download(models, type_w):
117
  for model in models:
118
  download_files(model, type_w)
 
 
 
 
 
 
119
 
120
  def download_files(url, source):
121
  if '@' in url and (not url.startswith('http://') and not url.startswith('https://')):
@@ -145,6 +151,7 @@ def run_webui():
145
  os.chdir(install_path)
146
  if not os.path.exists(f'{install_path}/{rename_repo}'):
147
  os.system(f"git clone https://openi.pcl.ac.cn/2575044704/stable-diffusion-webui-v1.8.0 {install_path}/{rename_repo}")
 
148
  os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://hf-mirror.com/datasets/ACCC1380/private-model/resolve/main/kaggle/input/museum/131-half.safetensors -d /home/xlab-app-center/stable-diffusion-webui/models/Stable-diffusion -o [萌二次元]131-half.safetensors")
149
  if not os.path.exists(f'{install_path}/{rename_repo}'):
150
  print(f'在克隆 https://{git_url}/{webui_repo} 时出错')
 
116
  def model_download(models, type_w):
117
  for model in models:
118
  download_files(model, type_w)
119
+ def remove_restart():
120
+ os.chdir("/home/xlab-app-center/stable-diffusion-webui/html")
121
+ os.system("rm ./footer.html && wget -O footer.html https://hf-mirror.com/datasets/ACCA225/openxlab/resolve/main/footer.html")
122
+ os.chdir("/home/xlab-app-center/stable-diffusion-webui/modules")
123
+ os.system("rm ./ui_settings.py && wget -O ui_settings.py https://hf-mirror.com/datasets/ACCA225/openxlab/resolve/main/ui_settings.py")
124
+
125
 
126
  def download_files(url, source):
127
  if '@' in url and (not url.startswith('http://') and not url.startswith('https://')):
 
151
  os.chdir(install_path)
152
  if not os.path.exists(f'{install_path}/{rename_repo}'):
153
  os.system(f"git clone https://openi.pcl.ac.cn/2575044704/stable-diffusion-webui-v1.8.0 {install_path}/{rename_repo}")
154
+ remove_restart()
155
  os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://hf-mirror.com/datasets/ACCC1380/private-model/resolve/main/kaggle/input/museum/131-half.safetensors -d /home/xlab-app-center/stable-diffusion-webui/models/Stable-diffusion -o [萌二次元]131-half.safetensors")
156
  if not os.path.exists(f'{install_path}/{rename_repo}'):
157
  print(f'在克隆 https://{git_url}/{webui_repo} 时出错')