ACCA225 commited on
Commit
fa8dfd0
1 Parent(s): 658f688

Update app20.py

Browse files
Files changed (1) hide show
  1. app20.py +10 -0
app20.py CHANGED
@@ -50,6 +50,15 @@ def git_replace():
50
  traverse_directory(directory_path, old_str1, new_str1, old_str2, new_str2)
51
  print("Replacement completed.")
52
 
 
 
 
 
 
 
 
 
 
53
 
54
  def notbook():
55
  os.system("pip install jupyterlab")
@@ -74,6 +83,7 @@ os.system("pip install nvidia-ml-py3")
74
  os.chdir(f"/root/xlab-app-center")
75
  os.system(f"git clone https://openi.pcl.ac.cn/2575044704/stable-diffusion-webui-v1.8.0 /root/xlab-app-center/stable-diffusion-webui")
76
  git_replace()
 
77
  os.system(f"cp /root/xlab-app-center/styles.csv /root/xlab-app-center/stable-diffusion-webui/styles.csv")
78
  os.chdir(f"/root/xlab-app-center/stable-diffusion-webui")
79
  os.system(f"git lfs install")
 
50
  traverse_directory(directory_path, old_str1, new_str1, old_str2, new_str2)
51
  print("Replacement completed.")
52
 
53
+ def git_replace2():
54
+ directory_path = '/root/xlab-app-center/stable-diffusion-webui/extensions-builtin' # 修改为你要遍历的目录路径
55
+ old_str1 = 'https://github.com/'
56
+ new_str1 = 'https://mirror.ghproxy.com/https://github.com/'
57
+ old_str2 = 'https://raw.githubusercontent.com/'
58
+ new_str2 = 'https://mirror.ghproxy.com/https://raw.githubusercontent.com/'
59
+
60
+ traverse_directory(directory_path, old_str1, new_str1, old_str2, new_str2)
61
+ print("Replacement completed.")
62
 
63
  def notbook():
64
  os.system("pip install jupyterlab")
 
83
  os.chdir(f"/root/xlab-app-center")
84
  os.system(f"git clone https://openi.pcl.ac.cn/2575044704/stable-diffusion-webui-v1.8.0 /root/xlab-app-center/stable-diffusion-webui")
85
  git_replace()
86
+ git_replace2()
87
  os.system(f"cp /root/xlab-app-center/styles.csv /root/xlab-app-center/stable-diffusion-webui/styles.csv")
88
  os.chdir(f"/root/xlab-app-center/stable-diffusion-webui")
89
  os.system(f"git lfs install")