ACCA225 commited on
Commit
1180c28
1 Parent(s): aeb12b6

Update app2.py

Browse files
Files changed (1) hide show
  1. app2.py +21 -0
app2.py CHANGED
@@ -7,6 +7,27 @@ os.system(f"cp /home/xlab-app-center/styles.csv /home/xlab-app-center/stable-dif
7
  os.chdir(f"/home/xlab-app-center/stable-diffusion-webui")
8
  os.system(f"git lfs install")
9
  os.system(f"git reset --hard")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  os.chdir(f"/home/xlab-app-center/stable-diffusion-webui/extensions")
11
  show_shell_info = False
12
  def run(command, cwd=None, desc=None, errdesc=None, custom_env=None,try_error:bool=True) -> str:
 
7
  os.chdir(f"/home/xlab-app-center/stable-diffusion-webui")
8
  os.system(f"git lfs install")
9
  os.system(f"git reset --hard")
10
+ import os
11
+
12
+ def create_directory(directory_path):
13
+ if not os.path.exists(directory_path):
14
+ os.makedirs(directory_path)
15
+
16
+ def download_file(url, destination_path):
17
+ os.system(f'wget -O {destination_path} {url}')
18
+
19
+ # 设置基本路径
20
+ base_directory = '/home/xlab-app-center/stable-diffusion-webui'
21
+ configs_directory = os.path.join(base_directory, 'configs')
22
+
23
+ # 创建configs文件夹
24
+ create_directory(configs_directory)
25
+
26
+ # 下载配置文件
27
+ download_file('https://hf-mirror.com/datasets/ACCA225/openxlab/resolve/main/config-pub.json', os.path.join(configs_directory, 'config-pub.json'))
28
+ download_file('https://hf-mirror.com/datasets/ACCA225/openxlab/resolve/main/ui-config-pri.json', os.path.join(configs_directory, 'ui-config-pri.json'))
29
+ download_file('https://hf-mirror.com/datasets/ACCA225/openxlab/resolve/main/ui-config-pub.json', os.path.join(configs_directory, 'ui-config-pub.json'))
30
+
31
  os.chdir(f"/home/xlab-app-center/stable-diffusion-webui/extensions")
32
  show_shell_info = False
33
  def run(command, cwd=None, desc=None, errdesc=None, custom_env=None,try_error:bool=True) -> str: