Spaces:
Running
Running
Commit
·
76a1a21
1
Parent(s):
0507080
InstallReActor
Browse files- scripts/mainrunpodA1111.py +45 -6
scripts/mainrunpodA1111.py
CHANGED
|
@@ -442,7 +442,41 @@ def InstallDeforum():
|
|
| 442 |
# call('git pull', shell=True, stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w'))
|
| 443 |
# Возврат в корневую директорию
|
| 444 |
os.chdir("/workspace")
|
| 445 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 446 |
|
| 447 |
def InstallAnimateDiff():
|
| 448 |
# Переход в директорию расширений
|
|
@@ -450,6 +484,7 @@ def InstallAnimateDiff():
|
|
| 450 |
|
| 451 |
# Проверка наличия директории с расширением
|
| 452 |
if not os.path.exists("sd-webui-animatediff"):
|
|
|
|
| 453 |
# Клонирование репозитория, если он не существует
|
| 454 |
call(
|
| 455 |
"git clone https://github.com/continue-revolution/sd-webui-animatediff.git",
|
|
@@ -462,12 +497,16 @@ def InstallAnimateDiff():
|
|
| 462 |
# Скачивание моделей для animatediff
|
| 463 |
call(
|
| 464 |
"wget https://huggingface.co/guoyww/animatediff/resolve/refs%2Fpr%2F3/mm_sd_v15_v2.ckpt",
|
| 465 |
-
shell=True,
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
"wget https://huggingface.co/manshoety/AD_Stabilized_Motion/resolve/main/mm-Stabilized_high.pth",
|
| 469 |
-
shell=True,
|
| 470 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 471 |
# Вовзрат в корневую директорию
|
| 472 |
os.chdir("/workspace")
|
| 473 |
else:
|
|
|
|
| 442 |
# call('git pull', shell=True, stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w'))
|
| 443 |
# Возврат в корневую директорию
|
| 444 |
os.chdir("/workspace")
|
| 445 |
+
|
| 446 |
+
def InstallReActor():
|
| 447 |
+
# Переход в директорию расширений
|
| 448 |
+
os.chdir("/workspace/sd/stable-diffusion-webui/extensions")
|
| 449 |
+
# Проверка наличия директории с расширением
|
| 450 |
+
if not os.path.exists("sd-webui-reactor"):
|
| 451 |
+
# Установка библиотек
|
| 452 |
+
from subprocess import call, DEVNULL
|
| 453 |
+
call(
|
| 454 |
+
'pip install "onnxruntime-gpu>=1.16.1"',
|
| 455 |
+
shell=True
|
| 456 |
+
)
|
| 457 |
+
# Клонирование репозитория, если он не существует
|
| 458 |
+
call(
|
| 459 |
+
"git clone https://github.com/Gourieff/sd-webui-reactor.git",
|
| 460 |
+
shell=True,
|
| 461 |
+
)
|
| 462 |
+
# Создание папки под модели
|
| 463 |
+
call(
|
| 464 |
+
"mkdir /workspace/sd/stable-diffusion-webui/models/insightface",
|
| 465 |
+
shell=True
|
| 466 |
+
)
|
| 467 |
+
os.chdir("/workspace/sd/stable-diffusion-webui/models/insightface")
|
| 468 |
+
# Скачивание модели для reActor
|
| 469 |
+
call(
|
| 470 |
+
"wget https://github.com/facefusion/facefusion-assets/releases/download/models/inswapper_128.onnx",
|
| 471 |
+
shell=True,
|
| 472 |
+
stdout=DEVNULL,
|
| 473 |
+
stderr=DEVNULL
|
| 474 |
+
)
|
| 475 |
+
# Вовзрат в корневую директорию
|
| 476 |
+
os.chdir("/workspace")
|
| 477 |
+
else:
|
| 478 |
+
Возврат в корневую директорию
|
| 479 |
+
os.chdir("/workspace")
|
| 480 |
|
| 481 |
def InstallAnimateDiff():
|
| 482 |
# Переход в директорию расширений
|
|
|
|
| 484 |
|
| 485 |
# Проверка наличия директории с расширением
|
| 486 |
if not os.path.exists("sd-webui-animatediff"):
|
| 487 |
+
from subprocess import call, DEVNULL
|
| 488 |
# Клонирование репозитория, если он не существует
|
| 489 |
call(
|
| 490 |
"git clone https://github.com/continue-revolution/sd-webui-animatediff.git",
|
|
|
|
| 497 |
# Скачивание моделей для animatediff
|
| 498 |
call(
|
| 499 |
"wget https://huggingface.co/guoyww/animatediff/resolve/refs%2Fpr%2F3/mm_sd_v15_v2.ckpt",
|
| 500 |
+
shell=True,
|
| 501 |
+
stdout=DEVNULL,
|
| 502 |
+
stderr=DEVNULL
|
|
|
|
|
|
|
| 503 |
)
|
| 504 |
+
# call(
|
| 505 |
+
# "wget https://huggingface.co/manshoety/AD_Stabilized_Motion/resolve/main/mm-Stabilized_high.pth",
|
| 506 |
+
# shell=True,
|
| 507 |
+
# stdout=DEVNULL,
|
| 508 |
+
# stderr=DEVNULL
|
| 509 |
+
# )
|
| 510 |
# Вовзрат в корневую директорию
|
| 511 |
os.chdir("/workspace")
|
| 512 |
else:
|