Upload UmeAiRT-WAN2.1-Sageattention_install.bat
Browse files
scripts/Add-on/UmeAiRT-WAN2.1-Sageattention_install.bat
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@echo off
|
| 2 |
+
setlocal enabledelayedexpansion
|
| 3 |
+
|
| 4 |
+
set "basePath=%CD%"
|
| 5 |
+
set "comfyPath=%basePath%\ComfyUI"
|
| 6 |
+
set "pythonPath=%basePath%\python_embeded"
|
| 7 |
+
set "customNodesPath=%comfyPath%\custom_nodes"
|
| 8 |
+
|
| 9 |
+
if not exist "%basePath%\logs" mkdir "%basePath%\logs"
|
| 10 |
+
|
| 11 |
+
curl -L -o banner.txt https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/others/banner.txt?download=true >> "%basePath%\logs\SageAttention.txt" 2>&1
|
| 12 |
+
echo -------------------------------------------------------------------------------[34m
|
| 13 |
+
type banner.txt
|
| 14 |
+
echo [0m-------------------------------------------------------------------------------
|
| 15 |
+
echo ComfyUI - WAN2.1 - SageAttention installer
|
| 16 |
+
echo V1.3
|
| 17 |
+
echo -------------------------------------------------------------------------------
|
| 18 |
+
del /f banner.txt
|
| 19 |
+
|
| 20 |
+
:check_folder
|
| 21 |
+
if exist "%basePath%\ComfyUI" (
|
| 22 |
+
echo ComfyUI folder detected
|
| 23 |
+
set "comfyPath=%basePath%\ComfyUI"
|
| 24 |
+
if exist "%basePath%\python_embeded" (
|
| 25 |
+
echo Python folder detected
|
| 26 |
+
set "pythonPath=%basePath%\python_embeded"
|
| 27 |
+
) else (
|
| 28 |
+
echo Python folder not detected, give Python folder path :
|
| 29 |
+
pause
|
| 30 |
+
)
|
| 31 |
+
) else if exist "%basePath%\ComfyUI_windows_portable" (
|
| 32 |
+
set "comfyPath=%basePath%\ComfyUI_windows_portable\ComfyUI"
|
| 33 |
+
set "pythonPath=%basePath%\ComfyUI_windows_portable\python_embeded"
|
| 34 |
+
echo ComfyUI folder detected
|
| 35 |
+
) else (
|
| 36 |
+
echo ComfyUI folder not detected, give ComfyUi folder path :
|
| 37 |
+
set /p "comfyPath=Path: "
|
| 38 |
+
echo Python folder not detected, give Python folder path :
|
| 39 |
+
set /p "pythonPath=Path: "
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
:CHOOSE_CLEAN
|
| 43 |
+
REM Ask user if they want to download FLUX SCHNELL Model
|
| 44 |
+
echo [33mDo you want to do a clean install? (old triton and sageattention will be deleted)[0m
|
| 45 |
+
echo [32mA) Yes[0m
|
| 46 |
+
echo [32mB) No[0m
|
| 47 |
+
set /p "CHOOSE_CLEAN=Enter your choice (A or B) and press Enter: "
|
| 48 |
+
|
| 49 |
+
if /i "%CHOOSE_CLEAN%"=="A" (
|
| 50 |
+
echo [33mUninstalling Triton and SageAttention...[0m
|
| 51 |
+
"%pythonPath%\python.exe" -m pip uninstall -y triton-windows >> "%basePath%\logs\SageAttention.txt" 2>&1
|
| 52 |
+
"%pythonPath%\python.exe" -m pip uninstall -y triton >> "%basePath%\logs\SageAttention.txt" 2>&1
|
| 53 |
+
"%pythonPath%\python.exe" -m pip uninstall -y sageattention >> "%basePath%\logs\SageAttention.txt" 2>&1
|
| 54 |
+
|
| 55 |
+
echo [33mRemoving SageAttention build files...[0m
|
| 56 |
+
rmdir /s /q "SageAttention" >> "%basePath%\logs\SageAttention.txt" 2>&1
|
| 57 |
+
rmdir /s /q "%pythonPath%\libs" >> "%basePath%\logs\SageAttention.txt" 2>&1
|
| 58 |
+
rmdir /s /q "%pythonPath%\include" >> "%basePath%\logs\SageAttention.txt" 2>&1
|
| 59 |
+
) else if /i "%CHOOSE_CLEAN%"=="B" (
|
| 60 |
+
set "CHOOSE_CLEANL=no"
|
| 61 |
+
) else (
|
| 62 |
+
echo [31mInvalid choice. Please enter A or B.[0m
|
| 63 |
+
goto CHOOSE_CLEAN
|
| 64 |
+
)
|
| 65 |
+
|
| 66 |
+
echo [33mInstalling Visual Studio Build Tools...[0m
|
| 67 |
+
winget install --id Microsoft.VisualStudio.2022.BuildTools -e --source winget --override "--quiet --wait --norestart --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.20348"
|
| 68 |
+
|
| 69 |
+
echo [33mInstalling Triton...[0m
|
| 70 |
+
curl -L -o "%pythonPath%\triton-3.3.0-py3-none-any.whl" https://github.com/woct0rdho/triton-windows/releases/download/empty/triton-3.3.0-py3-none-any.whl >> "%basePath%\logs\SageAttention.txt" 2>&1
|
| 71 |
+
"%pythonPath%\python.exe" -m pip install "%pythonPath%\triton-3.3.0-py3-none-any.whl" >> "%basePath%\logs\SageAttention.txt" 2>&1
|
| 72 |
+
"%pythonPath%\python.exe" -s -m pip install triton-windows >> "%basePath%\logs\SageAttention.txt" 2>&1
|
| 73 |
+
|
| 74 |
+
echo [33mDownloading Python include/libs...[0m
|
| 75 |
+
curl -L -o "%pythonPath%\python_3.12.9_include_libs.zip" https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/others/python_3.12.9_include_libs.zip?download=true >> "%basePath%\logs\SageAttention.txt" 2>&1
|
| 76 |
+
tar -xf "%pythonPath%\python_3.12.9_include_libs.zip" -C "%pythonPath%" >> "%basePath%\logs\SageAttention.txt" 2>&1
|
| 77 |
+
|
| 78 |
+
echo [33mDownloading SageAttention...[0m
|
| 79 |
+
git clone https://github.com/thu-ml/SageAttention.git >> "%basePath%\logs\SageAttention.txt" 2>&1
|
| 80 |
+
|
| 81 |
+
echo [33mInstalling SageAttention...[0m
|
| 82 |
+
"%pythonPath%\python.exe" -s -m pip install -e SageAttention >> "%basePath%\logs\SageAttention.txt" 2>&1
|
| 83 |
+
rmdir /s /q "SageAttention" >> "%basePath%\logs\SageAttention.txt" 2>&1
|
| 84 |
+
|
| 85 |
+
echo [33mInstallation complete[0m
|
| 86 |
+
pause
|