File size: 15,445 Bytes
f7c65d9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4fc08e4
 
 
f7c65d9
 
 
 
 
 
 
 
 
 
7deec71
f7c65d9
 
4fc08e4
 
f7c65d9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
@echo off
setlocal enabledelayedexpansion

set "installPath=%CD%"
set "basePath=%installPath%\ComfyUI_windows_portable"
set "comfyPath=%basePath%\ComfyUI"
set "customNodesPath=%comfyPath%\custom_nodes"
set "modelsPath=%comfyPath%\models"

if not exist "%installPath%\logs" mkdir "%installPath%\logs"

curl -L -o banner.txt https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/others/banner.txt?download=true >> "%installPath%\logs\install.txt" 2>&1
echo -------------------------------------------------------------------------------
type banner.txt
echo -------------------------------------------------------------------------------
echo                     ComfyUI - WAN2.1 - All in one installer                          
echo                                                                     V2.0          
echo -------------------------------------------------------------------------------
del /f banner.txt



REM Check if 7-Zip is installed and get its path
for %%I in (7z.exe) do set "SEVEN_ZIP_PATH=%%~$PATH:I"
if not defined SEVEN_ZIP_PATH (
    if exist "%ProgramFiles%\7-Zip\7z.exe" (
        set "SEVEN_ZIP_PATH=%ProgramFiles%\7-Zip\7z.exe"
    ) else if exist "%ProgramFiles(x86)%\7-Zip\7z.exe" (
        set "SEVEN_ZIP_PATH=%ProgramFiles(x86)%\7-Zip\7z.exe"
    ) else (
        echo 7-Zip is not installed. Downloading and installing...
        curl -L -o 7z-installer.exe https://www.7-zip.org/a/7z2201-x64.exe
        7z-installer.exe /S
        set "SEVEN_ZIP_PATH=%ProgramFiles%\7-Zip\7z.exe"
        if not exist "%SEVEN_ZIP_PATH%" (
            echo Installation of 7-Zip failed. Please install it manually and try again.
			pause
            exit /b 1
        )
        del 7z-installer.exe
    )
)



REM Check and install Git
git --version > NUL 2>&1
if %errorlevel% NEQ 0 (
    echo Installing Git...
    powershell -Command "& {Invoke-WebRequest -Uri 'https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.3/Git-2.41.0.3-64-bit.exe' -OutFile 'Git-2.41.0.3-64-bit.exe'; if ($LASTEXITCODE -ne 0) { exit 1 }}"
    if %errorlevel% NEQ 0 (
        echo Failed to download Git installer.
		pause
        exit /b
    )
    start /wait Git-2.41.0.3-64-bit.exe /VERYSILENT
    del Git-2.41.0.3-64-bit.exe
) 



REM Download ComfyUI
echo Downloading ComfyUI...
curl -L -o ComfyUI_windows_portable_nvidia.7z https://github.com/comfyanonymous/ComfyUI/releases/download/v0.3.27/ComfyUI_windows_portable_nvidia.7z



REM Extract ComfyUI
echo Extracting ComfyUI...
"%SEVEN_ZIP_PATH%" x ComfyUI_windows_portable_nvidia.7z -o"%CD%" -y  >> "%installPath%\logs\install.txt" 2>&1



REM Check if extraction was successful
if not exist "ComfyUI_windows_portable" (
    echo Extraction failed. Please check the downloaded file and try again.
	pause
    exit /b 1
)



REM Delete archive
del /f ComfyUI_windows_portable_nvidia.7z -force





REM Navigate to custom_nodes folder

REM Update ComfyUI
"%basePath%\python_embeded\python.exe" -m pip install --upgrade pip  >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" "%basePath%\update\update.py" "%basePath%\ComfyUI"  >> "%installPath%\logs\install.txt" 2>&1
if exist update_new.py (
  move /y update_new.py update.py
  echo Running updater again since it got updated.
  "%basePath%\python_embeded\python.exe" "%basePath%\update\update.py" "%basePath%\ComfyUI" --skip_self_update  >> "%installPath%\logs\install.txt" 2>&1
)
"%basePath%\python_embeded\python.exe" -s -m pip install -r "%basePath%/ComfyUI/requirements.txt"  >> "%installPath%\logs\install.txt" 2>&1

echo Installing xformers...
"%basePath%\python_embeded\python.exe" -s -m pip install xformers >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install pytorch-pretrained-bert >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install pytorch-extension >> "%installPath%\logs\install.txt" 2>&1
echo Installing NVIDIA Apex...
git clone https://github.com/NVIDIA/apex "%basePath%/python_embeded/apex" >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install -e "%basePath%/python_embeded/apex" >> "%installPath%\logs\install.txt" 2>&1

echo Installing Triton...
curl -L -o "%basePath%\python_embeded\triton-3.2.0-cp310-cp310-win_amd64.whl" https://github.com/woct0rdho/triton-windows/releases/download/v3.2.0-windows.post10/triton-3.2.0-cp310-cp310-win_amd64.whl  >> "%installPath%\logs\install.txt" 2>&1
curl -L -o "%basePath%\python_embeded\triton-3.2.0-cp311-cp311-win_amd64.whl" https://github.com/woct0rdho/triton-windows/releases/download/v3.2.0-windows.post10/triton-3.2.0-cp311-cp311-win_amd64.whl  >> "%installPath%\logs\install.txt" 2>&1
curl -L -o "%basePath%\python_embeded\triton-3.2.0-cp312-cp312-win_amd64.whl" https://github.com/woct0rdho/triton-windows/releases/download/v3.2.0-windows.post10/triton-3.2.0-cp312-cp312-win_amd64.whl  >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -m pip install "%basePath%\python_embeded\triton-3.2.0-cp310-cp310-win_amd64.whl"  >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -m pip install "%basePath%\python_embeded\triton-3.2.0-cp311-cp311-win_amd64.whl"  >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -m pip install "%basePath%\python_embeded\triton-3.2.0-cp312-cp312-win_amd64.whl"  >> "%installPath%\logs\install.txt" 2>&1



REM Clone ComfyUI-Manager
echo Installing ComfyUI-Manager...
git clone https://github.com/ltdrdata/ComfyUI-Manager.git "%customNodesPath%/ComfyUI-Manager" >> "%installPath%\logs\install.txt" 2>&1

echo Installing additional nodes...

echo   - Impact-Pack
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack "%customNodesPath%/ComfyUI-Impact-Pack" >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install -r "%customNodesPath%/ComfyUI-Impact-Pack/requirements.txt" --no-warn-script-location >> "%installPath%\logs\install.txt" 2>&1
git clone https://github.com/ltdrdata/ComfyUI-Impact-Subpack "%customNodesPath%/ComfyUI-Impact-Pack/impact_subpack" >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install -r "%customNodesPath%/ComfyUI-Impact-Pack/impact_subpack/requirements.txt" --no-warn-script-location >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install ultralytics --no-warn-script-location >> "%installPath%\logs\install.txt" 2>&1

echo   - GGUF
git clone https://github.com/city96/ComfyUI-GGUF "%customNodesPath%/ComfyUI-GGUF" >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install -r "%customNodesPath%/ComfyUI-GGUF/requirements.txt" --no-warn-script-location >> "%installPath%\logs\install.txt" 2>&1

echo   - mxToolkit
git clone https://github.com/Smirnov75/ComfyUI-mxToolkit "%customNodesPath%/ComfyUI-mxToolkit" >> "%installPath%\logs\install.txt" 2>&1

echo   - Custom-Scripts
git clone https://github.com/pythongosssss/ComfyUI-Custom-Scripts "%customNodesPath%/ComfyUI-Custom-Scripts" >> "%installPath%\logs\install.txt" 2>&1

echo   - KJNodes
git clone https://github.com/kijai/ComfyUI-KJNodes "%customNodesPath%/ComfyUI-KJNodes" >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install -r "%customNodesPath%/ComfyUI-KJNodes/requirements.txt" --no-warn-script-location >> "%installPath%\logs\install.txt" 2>&1

echo   - VideoHelperSuite
git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite "%customNodesPath%/ComfyUI-VideoHelperSuite" >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install -r "%customNodesPath%/ComfyUI-VideoHelperSuite/requirements.txt" --no-warn-script-location >> "%installPath%\logs\install.txt" 2>&1

echo   - Frame-Interpolation
git clone https://github.com/Fannovel16/ComfyUI-Frame-Interpolation "%customNodesPath%/ComfyUI-Frame-Interpolation" >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install -r "%customNodesPath%/ComfyUI-Frame-Interpolation/requirements-with-cupy.txt" --no-warn-script-location >> "%installPath%\logs\install.txt" 2>&1

echo   - rgthree
git clone https://github.com/rgthree/rgthree-comfy "%customNodesPath%/rgthree-comfy" >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install -r "%customNodesPath%/rgthree-comfy/requirements.txt" --no-warn-script-location >> "%installPath%\logs\install.txt" 2>&1

echo   - Easy-Use
git clone https://github.com/yolain/ComfyUI-Easy-Use "%customNodesPath%/ComfyUI-Easy-Use" >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install -r "%customNodesPath%/ComfyUI-Easy-Use/requirements.txt" --no-warn-script-location >> "%installPath%\logs\install.txt" 2>&1

echo   - PuLID_Flux_ll
git clone https://github.com/lldacing/ComfyUI_PuLID_Flux_ll "%customNodesPath%/ComfyUI_PuLID_Flux_ll" >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install -r "%customNodesPath%/ComfyUI_PuLID_Flux_ll/requirements.txt" --no-warn-script-location >> "%installPath%\logs\install.txt" 2>&1
curl -L -o "%basePath%\python_embeded\insightface-0.7.3-cp310-cp310-win_amd64.whl" https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/others/insightface-0.7.3-cp310-cp310-win_amd64.whl?download=true  >> "%installPath%\logs\install.txt" 2>&1
curl -L -o "%basePath%\python_embeded\insightface-0.7.3-cp311-cp311-win_amd64.whl" https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/others/insightface-0.7.3-cp311-cp311-win_amd64.whl?download=true  >> "%installPath%\logs\install.txt" 2>&1
curl -L -o "%basePath%\python_embeded\insightface-0.7.3-cp312-cp312-win_amd64.whl" https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/others/insightface-0.7.3-cp312-cp312-win_amd64.whl?download=true  >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -m pip install --use-pep517 facexlib  >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -m pip install git+https://github.com/rodjjo/filterpy.git  >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -m pip install onnxruntime==1.19.2 onnxruntime-gpu==1.15.1 "%basePath%\python_embeded\insightface-0.7.3-cp310-cp310-win_amd64.whl"  >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -m pip install onnxruntime==1.19.2 onnxruntime-gpu==1.15.1 "%basePath%\python_embeded\insightface-0.7.3-cp311-cp311-win_amd64.whl"  >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -m pip install onnxruntime==1.19.2 onnxruntime-gpu==1.17.1 "%basePath%\python_embeded\insightface-0.7.3-cp312-cp312-win_amd64.whl"  >> "%installPath%\logs\install.txt" 2>&1

echo   - HunyuanVideoMultiLora
git clone https://github.com/facok/ComfyUI-HunyuanVideoMultiLora "%customNodesPath%/ComfyUI-HunyuanVideoMultiLora" >> "%installPath%\logs\install.txt" 2>&1

echo   - was-node-suite-comfyui
git clone https://github.com/WASasquatch/was-node-suite-comfyui "%customNodesPath%/was-node-suite-comfyui" >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install -r "%customNodesPath%/was-node-suite-comfyui/requirements.txt" --no-warn-script-location >> "%installPath%\logs\install.txt" 2>&1

echo   - Florence2
git clone https://github.com/kijai/ComfyUI-Florence2  "%customNodesPath%/ComfyUI-Florence2">> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -m pip install transformers==4.49.0 --upgrade >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install -r "%customNodesPath%/ComfyUI-Florence2/requirements.txt" --no-warn-script-location >> "%installPath%\logs\install.txt" 2>&1

echo   - Upscaler-Tensorrt
git clone https://github.com/yuvraj108c/ComfyUI-Upscaler-Tensorrt "%customNodesPath%/ComfyUI-Upscaler-Tensorrt" >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install wheel-stub >> "%installPath%\logs\install.txt" 2>&1
"%basePath%\python_embeded\python.exe" -s -m pip install -r "%customNodesPath%/ComfyUI-Upscaler-Tensorrt/requirements.txt" --no-warn-script-location >> "%installPath%\logs\install.txt" 2>&1

echo   - MultiGPU
git clone https://github.com/pollockjj/ComfyUI-MultiGPU "%customNodesPath%/ComfyUI-MultiGPU" >> "%installPath%\logs\install.txt" 2>&1

echo   - WanStartEndFramesNative
git clone https://github.com/Flow-two/ComfyUI-WanStartEndFramesNative "%customNodesPath%/ComfyUI-WanStartEndFramesNative" >> "%installPath%\logs\install.txt" 2>&1

mkdir "%comfyPath%\user\default\workflows"
echo Downloading comfy settings...
curl -L -o "%comfyPath%\user\default\comfy.settings.json" https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/others/comfy.settings.json?download=true >> "%installPath%\logs\install.txt" 2>&1
echo Downloading comfy workflow...
curl -L -o "%comfyPath%\user\default\workflows\UmeAiRT-WAN21_workflow.7z" https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/workflows/UmeAiRT-WAN21_workflow.7z?download=true >> "%installPath%\logs\install.txt" 2>&1
"%SEVEN_ZIP_PATH%" x "%comfyPath%\user\default\workflows\UmeAiRT-WAN21_workflow.7z" -o"%comfyPath%\user\default\workflows\" -y   >> "%installPath%\logs\install.txt" 2>&1
del /f "%comfyPath%\user\default\workflows\UmeAiRT-WAN21_workflow.7z" -force   >> "%installPath%\logs\install.txt" 2>&1

curl -L -o "%installPath%/UmeAiRT-WAN2.1-Missing_nodes.bat" "https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/UmeAiRT-WAN2.1-Missing_nodes.bat?download=true"  >> "%installPath%\logs\install.txt" 2>&1
curl -L -o "%installPath%/UmeAiRT-WAN2.1-Model_downloader.bat" "https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/UmeAiRT-WAN2.1-Model_downloader.bat?download=true"  >> "%installPath%\logs\install.txt" 2>&1
curl -L -o "%installPath%/UmeAiRT-WAN2.1-Sageattention_install.bat" "https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/UmeAiRT-WAN2.1-Sageattention_install.bat?download=true"  >> "%installPath%\logs\install.txt" 2>&1



REM Final steps based on user choice
curl -L -o "%basePath%/run_nvidia_gpu-LOWVRAM.bat" https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/scripts/run_nvidia_gpu-LOWVRAM.bat?download=true
curl -L -o "%basePath%/run_nvidia_gpu-sageattention.bat" https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/scripts/run_nvidia_gpu-sageattention.bat?download=true

:CHOOSE_DOWNLOAD_MODELS

REM Ask user for installation type
echo Would you like to download models?
set /p "MODELS=Enter your choice (Y or N) and press Enter: "

if /i "%MODELS%"=="Y" (
    call "%installPath%\UmeAiRT-WAN2.1-Model_downloader.bat"
) else if /i "%MODELS%"=="N" (

    REM Do nothing, just continue
) else (
    echo Invalid choice. Please enter Y or N.
    goto CHOOSE_DOWNLOAD_MODELS
)
echo ComfyUI installed.
pause