Update v2_3.py
Browse files
v2_3.py
CHANGED
|
@@ -190,20 +190,20 @@ for repo_url, destination in extensions_to_clone:
|
|
| 190 |
|
| 191 |
print ("修改启动文件...")
|
| 192 |
# 打开launch.py文件
|
| 193 |
-
with open("/
|
| 194 |
# 读取文件内容
|
| 195 |
content = f.read()
|
| 196 |
# 在from modules import launch_utils后面插入import os
|
| 197 |
content = content.replace("from modules import launch_utils", "from modules import launch_utils\nimport os")
|
| 198 |
# 在prepare_environment()后面插入os.system命令
|
| 199 |
-
content = content.replace("prepare_environment()", "prepare_environment()\n os.system(f\"\"\"sed -i -e ''\"s/stable/dict()))/dict())).cuda()/g\"'' /
|
| 200 |
# 重写文件内容
|
| 201 |
f.seek(0)
|
| 202 |
f.write(content)
|
| 203 |
f.truncate()
|
| 204 |
|
| 205 |
# 打开shared.py文件
|
| 206 |
-
with open("/
|
| 207 |
# 读取文件内容
|
| 208 |
content = f.read()
|
| 209 |
# 替换["sd_model_checkpoint"]为["sd_model_checkpoint","sd_vae","CLIP_stop_at_last_layers"]
|
|
@@ -297,20 +297,20 @@ if T2I_:
|
|
| 297 |
|
| 298 |
print ("修改启动文件...")
|
| 299 |
# 打开launch.py文件
|
| 300 |
-
with open("/
|
| 301 |
# 读取文件内容
|
| 302 |
content = f.read()
|
| 303 |
# 在from modules import launch_utils后面插入import os
|
| 304 |
content = content.replace("from modules import launch_utils", "from modules import launch_utils\nimport os")
|
| 305 |
# 在prepare_environment()后面插入os.system命令
|
| 306 |
-
content = content.replace("prepare_environment()", "prepare_environment()\n os.system(f\"\"\"sed -i -e ''\"s/dict()))/dict())).cuda()/g\"'' /
|
| 307 |
# 重写文件内容
|
| 308 |
f.seek(0)
|
| 309 |
f.write(content)
|
| 310 |
f.truncate()
|
| 311 |
|
| 312 |
# 打开shared.py文件
|
| 313 |
-
with open("/
|
| 314 |
# 读取文件内容
|
| 315 |
content = f.read()
|
| 316 |
# 替换["sd_model_checkpoint"]为["sd_model_checkpoint","sd_vae","CLIP_stop_at_last_layers"]
|
|
|
|
| 190 |
|
| 191 |
print ("修改启动文件...")
|
| 192 |
# 打开launch.py文件
|
| 193 |
+
with open("/bushu/ui/launch.py", "r+") as f:
|
| 194 |
# 读取文件内容
|
| 195 |
content = f.read()
|
| 196 |
# 在from modules import launch_utils后面插入import os
|
| 197 |
content = content.replace("from modules import launch_utils", "from modules import launch_utils\nimport os")
|
| 198 |
# 在prepare_environment()后面插入os.system命令
|
| 199 |
+
content = content.replace("prepare_environment()", "prepare_environment()\n os.system(f\"\"\"sed -i -e ''\"s/stable/dict()))/dict())).cuda()/g\"'' /bushu/ui/repositories/diffusion-stability-stable/ldm/util.py\"\"\")")
|
| 200 |
# 重写文件内容
|
| 201 |
f.seek(0)
|
| 202 |
f.write(content)
|
| 203 |
f.truncate()
|
| 204 |
|
| 205 |
# 打开shared.py文件
|
| 206 |
+
with open("/bushu/ui/modules/shared.py", "r+") as f:
|
| 207 |
# 读取文件内容
|
| 208 |
content = f.read()
|
| 209 |
# 替换["sd_model_checkpoint"]为["sd_model_checkpoint","sd_vae","CLIP_stop_at_last_layers"]
|
|
|
|
| 297 |
|
| 298 |
print ("修改启动文件...")
|
| 299 |
# 打开launch.py文件
|
| 300 |
+
with open("/bushu/ui/launch.py", "r+") as f:
|
| 301 |
# 读取文件内容
|
| 302 |
content = f.read()
|
| 303 |
# 在from modules import launch_utils后面插入import os
|
| 304 |
content = content.replace("from modules import launch_utils", "from modules import launch_utils\nimport os")
|
| 305 |
# 在prepare_environment()后面插入os.system命令
|
| 306 |
+
content = content.replace("prepare_environment()", "prepare_environment()\n os.system(f\"\"\"sed -i -e ''\"s/dict()))/dict())).cuda()/g\"'' /bushu/ui/repositories/stable-diffusion-stability-ai/ldm/util.py\"\"\")")
|
| 307 |
# 重写文件内容
|
| 308 |
f.seek(0)
|
| 309 |
f.write(content)
|
| 310 |
f.truncate()
|
| 311 |
|
| 312 |
# 打开shared.py文件
|
| 313 |
+
with open("/bushu/ui/modules/shared.py", "r+") as f:
|
| 314 |
# 读取文件内容
|
| 315 |
content = f.read()
|
| 316 |
# 替换["sd_model_checkpoint"]为["sd_model_checkpoint","sd_vae","CLIP_stop_at_last_layers"]
|