Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -160,6 +160,13 @@ extensions_dir = webui_dir / "extensions"
|
|
| 160 |
fluxdev_dir = extensions_dir / "Fluxdev"
|
| 161 |
fluxschnell_dir = extensions_dir / "Fluxschnell"
|
| 162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
# WebUI のディレクトリへ移動
|
| 164 |
os.chdir(webui_dir)
|
| 165 |
|
|
@@ -171,6 +178,14 @@ if not fluxdev_dir.exists():
|
|
| 171 |
if not fluxschnell_dir.exists():
|
| 172 |
os.system(f"git clone https://github.com/FluxAi/Fluxschnell {fluxschnell_dir}")
|
| 173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
|
| 175 |
print("Done\nStarting Webui...")
|
| 176 |
os.chdir(user_home / r"stable-diffusion-webui")
|
|
|
|
| 160 |
fluxdev_dir = extensions_dir / "Fluxdev"
|
| 161 |
fluxschnell_dir = extensions_dir / "Fluxschnell"
|
| 162 |
|
| 163 |
+
# モデルの保存先
|
| 164 |
+
model_dir = webui_dir / "models" / "Stable-diffusion"
|
| 165 |
+
|
| 166 |
+
# ダウンロードするモデルのURL(適宜変更)
|
| 167 |
+
model_url = "https://civitai.com/api/download/models/39164"
|
| 168 |
+
model_path = model_dir / "backlighting.safetensors"
|
| 169 |
+
|
| 170 |
# WebUI のディレクトリへ移動
|
| 171 |
os.chdir(webui_dir)
|
| 172 |
|
|
|
|
| 178 |
if not fluxschnell_dir.exists():
|
| 179 |
os.system(f"git clone https://github.com/FluxAi/Fluxschnell {fluxschnell_dir}")
|
| 180 |
|
| 181 |
+
# モデルフォルダが存在しない場合は作成
|
| 182 |
+
model_dir.mkdir(parents=True, exist_ok=True)
|
| 183 |
+
|
| 184 |
+
# モデルをダウンロード(すでに存在しない場合のみ)
|
| 185 |
+
if not model_path.exists():
|
| 186 |
+
os.system(f"wget {model_url} -O {model_path}")
|
| 187 |
+
|
| 188 |
+
|
| 189 |
|
| 190 |
print("Done\nStarting Webui...")
|
| 191 |
os.chdir(user_home / r"stable-diffusion-webui")
|