Spaces:
Running
Running
stlaurentjr
commited on
Commit
•
a3030da
1
Parent(s):
3892aeb
Update scripts/mainrunpodA1111.py
Browse filesПроверяем, существует ли уже символическая ссылка VAE
- scripts/mainrunpodA1111.py +18 -5
scripts/mainrunpodA1111.py
CHANGED
@@ -146,12 +146,25 @@ def mdl(Original_Model_Version, Path_to_MODEL, MODEL_LINK):
|
|
146 |
import gdown
|
147 |
|
148 |
src=getsrc(MODEL_LINK)
|
149 |
-
|
150 |
-
if os.path.exists('/workspace/sd/stable-diffusion-webui/models/VAE'):
|
151 |
-
call('ln -s /workspace/auto-VAE/* /workspace/sd/stable-diffusion-webui/models/VAE', shell=True)
|
152 |
-
else:
|
153 |
call('mkdir -p /workspace/sd/stable-diffusion-webui/models/VAE', shell=True)
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
|
156 |
if not os.path.exists('/workspace/sd/stable-diffusion-webui/models/Stable-diffusion/SDv1-5.ckpt'):
|
157 |
call('ln -s /workspace/auto-models/* /workspace/sd/stable-diffusion-webui/models/Stable-diffusion', shell=True)
|
|
|
146 |
import gdown
|
147 |
|
148 |
src=getsrc(MODEL_LINK)
|
149 |
+
|
150 |
+
if not os.path.exists('/workspace/sd/stable-diffusion-webui/models/VAE'):
|
|
|
|
|
151 |
call('mkdir -p /workspace/sd/stable-diffusion-webui/models/VAE', shell=True)
|
152 |
+
|
153 |
+
# Получаем список файлов в директории /workspace/auto-VAE
|
154 |
+
files = os.listdir('/workspace/auto-VAE')
|
155 |
+
|
156 |
+
for file in files:
|
157 |
+
source_path = os.path.join('/workspace/auto-VAE', file)
|
158 |
+
target_path = os.path.join('/workspace/sd/stable-diffusion-webui/models/VAE', file)
|
159 |
+
# Проверяем, существует ли уже символическая ссылка
|
160 |
+
if not os.path.exists(target_path):
|
161 |
+
call(f'ln -s {source_path} {target_path}', shell=True)
|
162 |
+
|
163 |
+
#if os.path.exists('/workspace/sd/stable-diffusion-webui/models/VAE'):
|
164 |
+
# call('ln -s /workspace/auto-VAE/* /workspace/sd/stable-diffusion-webui/models/VAE', shell=True)
|
165 |
+
#else:
|
166 |
+
# call('mkdir -p /workspace/sd/stable-diffusion-webui/models/VAE', shell=True)
|
167 |
+
# call('ln -s /workspace/auto-VAE/* /workspace/sd/stable-diffusion-webui/models/VAE', shell=True)
|
168 |
|
169 |
if not os.path.exists('/workspace/sd/stable-diffusion-webui/models/Stable-diffusion/SDv1-5.ckpt'):
|
170 |
call('ln -s /workspace/auto-models/* /workspace/sd/stable-diffusion-webui/models/Stable-diffusion', shell=True)
|