From c8cce8a98b0af49aa5773a657b9f88872b27cefa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=92=E9=BE=8D=E8=81=96=E8=80=85=40bdsqlsz?= Date: Wed, 6 Dec 2023 23:14:07 +0800 Subject: [PATCH] add install option --- install.ps1 | 5 ++++- install_cn.ps1 | 28 +++++++++++++++++++--------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/install.ps1 b/install.ps1 index 4e3eabcd..d180a6bb 100644 --- a/install.ps1 +++ b/install.ps1 @@ -25,9 +25,12 @@ if (!(Test-Path -Path "MagicAnimate")) { git clone https://huggingface.co/zcxu-eric/MagicAnimate } -if (!(Test-Path -Path "stable-diffusion-v1-5")) { +$install_SD15 = Read-Host "Do you need to download SD15? If you don't have any SD15 model locally select y, if you want to change to another SD1.5 model select n. [y/n] (Default is y)" +if ($install_SD15 -eq "y" -or $install_SD15 -eq "Y" -or $install_SD15 -eq ""){ + if (!(Test-Path -Path "stable-diffusion-v1-5")) { Write-Output "Downloading stable-diffusion-v1-5 models..." git clone https://huggingface.co/bdsqlsz/stable-diffusion-v1-5 + } } Write-Output "Install completed" diff --git a/install_cn.ps1 b/install_cn.ps1 index fa6e492c..2b16903a 100644 --- a/install_cn.ps1 +++ b/install_cn.ps1 @@ -3,32 +3,42 @@ Set-Location $PSScriptRoot $Env:PIP_DISABLE_PIP_VERSION_CHECK = 1 if (!(Test-Path -Path "venv")) { - Write-Output "Creating venv for python..." + Write-Output "创建python虚拟环境venv..." python -m venv venv } .\venv\Scripts\activate -Write-Output "Installing deps..." +Write-Output "安装依赖..." pip install -U -r requirements-windows.txt -i https://mirror.baidu.com/pypi/simple -Write-Output "Checking models..." +Write-Output "检查模型..." if (!(Test-Path -Path "pretrained_models")) { - Write-Output "Creating pretrained_models..." + Write-Output "创建模型文件夹..." mkdir "pretrained_models" } Set-Location .\pretrained_models if (!(Test-Path -Path "MagicAnimate")) { - Write-Output "Downloading MagicAnimate models..." + Write-Output "下载MagicAnimate模型..." git clone https://huggingface.co/zcxu-eric/MagicAnimate } +if (Test-Path -Path "MagicAnimate/.git/lfs") { + Remove-Item -Path MagicAnimate/.git/lfs/* -Recurse -Force +} -if (!(Test-Path -Path "stable-diffusion-v1-5")) { - Write-Output "Downloading stable-diffusion-v1-5 models..." - git clone https://huggingface.co/bdsqlsz/stable-diffusion-v1-5 +$install_SD15 = Read-Host "是否需要下载huggingface的SD15模型? 若您本地没有任何SD15模型选择y,如果想要换其他SD1.5模型选择 n。[y/n] (默认为 y)" +if ($install_SD15 -eq "y" -or $install_SD15 -eq "Y" -or $install_SD15 -eq "") { + if (!(Test-Path -Path "stable-diffusion-v1-5")) { + Write-Output "下载 stable-diffusion-v1-5 模型..." + git clone https://huggingface.co/bdsqlsz/stable-diffusion-v1-5 + + } + if (Test-Path -Path "stable-diffusion-v1-5/.git/lfs") { + Remove-Item -Path stable-diffusion-v1-5/.git/lfs/* -Recurse -Force + } } -Write-Output "Install completed" +Write-Output "安装完毕" Read-Host | Out-Null ;