vslinx commited on
Commit
6ef29f5
·
1 Parent(s): 3e91996

upload install script for v4.0

Browse files
Files changed (1) hide show
  1. windows-nvidia.bat +293 -0
windows-nvidia.bat ADDED
@@ -0,0 +1,293 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ setlocal enabledelayedexpansion
3
+
4
+ echo.
5
+ echo ============================
6
+ echo ComfyUI Auto Installer
7
+ echo ============================
8
+ echo.
9
+
10
+ REM Define paths
11
+ set "comfyPath=%CD%\ComfyUI"
12
+ set "customNodesPath=%comfyPath%\custom_nodes"
13
+ set "venvPath=%comfyPath%\venv"
14
+ set "pythonPath=%venvPath%\Scripts\python.exe"
15
+ set "activateScript=%venvPath%\Scripts\activate.bat"
16
+
17
+ REM -------------------------------
18
+ REM Check if Python is available
19
+ REM -------------------------------
20
+ where python >nul 2>&1
21
+ if %errorlevel% NEQ 0 (
22
+ echo Python is not found in PATH.
23
+ echo Would you like to install Python 3.12 now? [Y/N]
24
+ set /p "PYINSTALL=Your choice [Y/N]: "
25
+ if /i "!PYINSTALL!"=="Y" (
26
+ echo Downloading Python 3.12...
27
+ curl -L -o python-installer.exe https://www.python.org/ftp/python/3.12.3/python-3.12.3-amd64.exe
28
+ if not exist python-installer.exe (
29
+ echo Failed to download Python installer.
30
+ pause
31
+ exit /b 1
32
+ )
33
+ echo Installing Python 3.12...
34
+ start /wait python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
35
+ del /f python-installer.exe
36
+ ) else (
37
+ echo Cannot continue without Python. Exiting...
38
+ pause
39
+ exit /b 1
40
+ )
41
+ )
42
+
43
+ REM Get Python version from stderr
44
+ for /f "tokens=2 delims= " %%A in ('python -V 2^>^&1') do set PYVERSION=%%A
45
+
46
+ REM Parse major and minor
47
+ for /f "tokens=1,2 delims=." %%B in ("%PYVERSION%") do (
48
+ set "PYMAJOR=%%B"
49
+ set "PYMINOR=%%C"
50
+ )
51
+
52
+ echo Detected Python version: %PYVERSION%
53
+ if not "%PYMAJOR%.%PYMINOR%"=="3.12" (
54
+ echo Your current Python version is %PYVERSION%. It may not be supported.
55
+ echo Would you like to:
56
+ echo [Y] Install Python 3.12
57
+ echo [N] Continue using current version
58
+ set /p "PYCHOICE=Choose [Y/N]: "
59
+ if /i "!PYCHOICE!"=="Y" (
60
+ echo Downloading Python 3.12...
61
+ curl -L -o python-installer.exe https://www.python.org/ftp/python/3.12.3/python-3.12.3-amd64.exe
62
+ if not exist python-installer.exe (
63
+ echo Failed to download Python installer.
64
+ pause
65
+ exit /b 1
66
+ )
67
+ echo Installing Python 3.12...
68
+ start /wait python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
69
+ del /f python-installer.exe
70
+ )
71
+ )
72
+
73
+ REM -------------------------------
74
+ REM Check Git
75
+ REM -------------------------------
76
+ git --version >nul 2>&1
77
+ if %errorlevel% NEQ 0 (
78
+ echo Git not found. Installing Git...
79
+ 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_installer.exe'}"
80
+ if %errorlevel% NEQ 0 (
81
+ echo Failed to download Git.
82
+ pause
83
+ exit /b 1
84
+ )
85
+ start /wait git_installer.exe /VERYSILENT
86
+ del /f git_installer.exe
87
+ echo Git installed successfully.
88
+ )
89
+
90
+ REM -------------------------------
91
+ REM Clone ComfyUI
92
+ REM -------------------------------
93
+ if not exist "%comfyPath%" (
94
+ echo Cloning ComfyUI...
95
+ git clone https://github.com/comfyanonymous/ComfyUI.git "%comfyPath%"
96
+ ) else (
97
+ echo ComfyUI already exists. Skipping clone.
98
+ )
99
+
100
+ REM -------------------------------
101
+ REM Create venv
102
+ REM -------------------------------
103
+ if not exist "%venvPath%" (
104
+ echo Creating virtual environment...
105
+ python -m venv "%venvPath%"
106
+ )
107
+
108
+ REM -------------------------------
109
+ REM Activate venv and install deps
110
+ REM -------------------------------
111
+ call "%activateScript%"
112
+ echo Installing CUDA-enabled torch manually...
113
+ "%pythonPath%" -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu128
114
+
115
+ echo Installing dependencies...
116
+ "%pythonPath%" -m pip install --upgrade pip
117
+ "%pythonPath%" -m pip install -r "%comfyPath%\requirements.txt"
118
+
119
+ REM -------------------------------
120
+ REM Clone custom nodes
121
+ REM -------------------------------
122
+ if not exist "%customNodesPath%" (
123
+ mkdir "%customNodesPath%"
124
+ )
125
+
126
+ echo Cloning custom nodes...
127
+
128
+ set repos[0]=https://github.com/ltdrdata/ComfyUI-Impact-Pack
129
+ set repos[1]=https://github.com/ltdrdata/ComfyUI-Impact-Subpack
130
+ set repos[2]=https://github.com/Smirnov75/ComfyUI-mxToolkit
131
+ set repos[3]=https://github.com/yolain/ComfyUI-Easy-Use
132
+ set repos[4]=https://github.com/pythongosssss/ComfyUI-Custom-Scripts
133
+ set repos[5]=https://github.com/crystian/ComfyUI-Crystools
134
+ set repos[6]=https://github.com/alexopus/ComfyUI-Image-Saver
135
+ set repos[7]=https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes
136
+ set repos[8]=https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet
137
+ set repos[9]=https://github.com/kijai/ComfyUI-KJNodes
138
+ set repos[10]=https://github.com/Fannovel16/comfyui_controlnet_aux
139
+ set repos[11]=https://github.com/chrisgoringe/cg-use-everywhere
140
+ set repos[12]=https://github.com/chrisgoringe/cg-image-filter
141
+ set repos[13]=https://github.com/rgthree/rgthree-comfy
142
+ set repos[14]=https://github.com/cubiq/ComfyUI_IPAdapter_plus
143
+ set repos[15]=https://github.com/Comfy-Org/ComfyUI-Manager
144
+
145
+ for /L %%i in (0,1,15) do (
146
+ set "repo=!repos[%%i]!"
147
+ for %%A in (!repo!) do (
148
+ set "folderName=%%~nxA"
149
+ set "targetPath=%customNodesPath%\!folderName!"
150
+
151
+ if not exist "!targetPath!" (
152
+ echo - Cloning !folderName!...
153
+ git clone !repo! "!targetPath!"
154
+ ) else (
155
+ echo - !folderName! already exists. Skipping.
156
+ )
157
+
158
+ REM Install requirements if available
159
+ if exist "!targetPath!\requirements.txt" (
160
+ echo Installing requirements for !folderName!...
161
+ "%pythonPath%" -s -m pip install -r "!targetPath!\requirements.txt"
162
+ )
163
+ )
164
+ )
165
+
166
+ REM -------------------------------
167
+ REM Download JSON workflow file
168
+ REM -------------------------------
169
+ set "workflowFolder=%comfyPath%\user\default\workflows"
170
+ if not exist "%workflowFolder%" (
171
+ mkdir "%workflowFolder%"
172
+ )
173
+
174
+ set "workflowFileName=TXT2IMG-ADetailer-v4.0-vslinx.json"
175
+ set "workflowFilePath=%workflowFolder%\%workflowFileName%"
176
+ set "workflowUrl=https://huggingface.co/vslinx/ComfyUIDetailerWorkflow-vslinx/resolve/main/workflows/TXT2IMG/v4.0/%workflowFileName%"
177
+
178
+ if exist "%workflowFilePath%" (
179
+ echo - %workflowFileName% already exists. Skipping download.
180
+ ) else (
181
+ echo Downloading ADetailer workflow...
182
+ curl -L -o "%workflowFilePath%" "%workflowUrl%"
183
+ )
184
+
185
+ echo.
186
+ echo Would you like to download required models (ControlNet, IPAdapter, Upscale Model, etc.)?
187
+ echo [Y] Yes
188
+ echo [N] No
189
+ set /p "download_models=Choose [Y/N]: "
190
+
191
+ if /i "%download_models%"=="Y" (
192
+ echo Downloading required models...
193
+
194
+ REM Create folders if they don't exist
195
+ if not exist "%comfyPath%\models\vae" mkdir "%comfyPath%\models\vae"
196
+ if not exist "%comfyPath%\models\upscale_models" mkdir "%comfyPath%\models\upscale_models"
197
+ if not exist "%comfyPath%\models\ipadapter" mkdir "%comfyPath%\models\ipadapter"
198
+ if not exist "%comfyPath%\models\clip_vision" mkdir "%comfyPath%\models\clip_vision"
199
+ if not exist "%comfyPath%\models\controlnet" mkdir "%comfyPath%\models\controlnet"
200
+
201
+ REM Download files
202
+ echo Downloading VAE...
203
+ curl -L -o "%comfyPath%\models\vae\sdxl_vae.safetensors" ^
204
+ https://huggingface.co/stabilityai/sdxl-vae/resolve/main/sdxl_vae.safetensors
205
+
206
+ echo Downloading Upscale Model...
207
+ curl -L -o "%comfyPath%\models\upscale_models\4x_foolhardy_Remacri.pth" ^
208
+ https://huggingface.co/FacehugmanIII/4x_foolhardy_Remacri/resolve/main/4x_foolhardy_Remacri.pth
209
+
210
+ echo Downloading IPAdapter model...
211
+ curl -L -o "%comfyPath%\models\ipadapter\noobIPAMARK1_mark1.safetensors" ^
212
+ https://huggingface.co/vslinx/ComfyUIDetailerWorkflow-vslinx/resolve/main/models/IPAdapter/noobIPAMARK1_mark1.safetensors
213
+
214
+ echo Downloading CLIP Vision Model...
215
+ curl -L -o "%comfyPath%\models\clip_vision\CLIP-ViT-bigG-14-laion2B-39B-b160k.safetensors" ^
216
+ https://huggingface.co/XuminYu/example_safetensors/resolve/4b89d7ebd99a9913f0abbec4bf0f54932b11d243/CLIP-ViT-bigG-14-laion2B-39B-b160k.safetensors
217
+
218
+ echo Downloading ControlNet Canny Model...
219
+ curl -L -o "%comfyPath%\models\controlnet\noobaiXLControlnet_epsCanny.safetensors" ^
220
+ https://huggingface.co/Eugeoter/noob-sdxl-controlnet-canny/resolve/main/noob_sdxl_controlnet_canny.safetensors
221
+
222
+ echo Downloading ControlNet DepthMidas Model...
223
+ curl -L -o "%comfyPath%\models\controlnet\noobaiXLControlnet_epsDepthMidasv1-1.safetensors" ^
224
+ https://huggingface.co/Eugeoter/noob-sdxl-controlnet-depth_midas-v1-1/resolve/main/noob-sdxl-controlnet-depth-midas-v1-1.safetensors
225
+
226
+ echo Downloading ControlNet Lineart-Anime Model...
227
+ curl -L -o "%comfyPath%\models\controlnet\noobaiXLControlnet_epsLineartAnime.safetensors" ^
228
+ https://huggingface.co/Eugeoter/noob-sdxl-controlnet-lineart_anime/resolve/main/noob-sdxl-controlnet-lineart_anime.safetensors
229
+
230
+ echo Downloading ControlNet Lineart-Realistic Model...
231
+ curl -L -o "%comfyPath%\models\controlnet\noobaiXLControlnet_epsLineartRealistic.safetensors" ^
232
+ https://huggingface.co/Eugeoter/noob-sdxl-controlnet-lineart_realistic/resolve/main/noob-sdxl-controlnet-lineart_realistic.safetensors
233
+
234
+ echo Downloading ControlNet Manga line Model...
235
+ curl -L -o "%comfyPath%\models\controlnet\noobaiXLControlnet_epsMangaLine.safetensors" ^
236
+ https://huggingface.co/Eugeoter/noob-sdxl-controlnet-manga_line/resolve/main/noob-sdxl-controlnet-manga-line.safetensors
237
+
238
+ echo Downloading ControlNet OpenPose Model...
239
+ curl -L -o "%comfyPath%\models\controlnet\noobaiXLControlnet_epsOpenPose.safetensors" ^
240
+ https://huggingface.co/Laxhar/noob_openpose/resolve/main/openpose_pre.safetensors
241
+
242
+ echo Downloading ControlNet Softedge Hed Model...
243
+ curl -L -o "%comfyPath%\models\controlnet\noobaiXLControlnet_epsSoftedgeHed.safetensors" ^
244
+ https://huggingface.co/Eugeoter/noob-sdxl-controlnet-softedge_hed/resolve/main/noob-sdxl-controlnet-softedge_hed.safetensors
245
+
246
+ echo Downloading ControlNet Depth Model...
247
+ curl -L -o "%comfyPath%\models\controlnet\noobaiXLControlnet_epsDepth.safetensors" ^
248
+ https://huggingface.co/Eugeoter/noob-sdxl-controlnet-depth/resolve/main/noob_sdxl_controlnet_depth.safetensors
249
+
250
+ echo All required models have been downloaded.
251
+ ) else (
252
+ echo Skipping model downloads.
253
+ )
254
+
255
+ REM -------------------------------
256
+ REM Setup Complete
257
+ REM -------------------------------
258
+ echo.
259
+ echo ============================
260
+ echo Setup Complete!
261
+ echo ============================
262
+
263
+ REM -------------------------------
264
+ REM Offer to create Desktop shortcut
265
+ REM -------------------------------
266
+ echo Would you like to create a desktop shortcut to start ComfyUI?
267
+ echo [Y] Yes
268
+ echo [N] No
269
+ set /p "MAKE_SHORTCUT=Choose [Y/N]: "
270
+
271
+ if /i "!MAKE_SHORTCUT!"=="Y" (
272
+ set "shortcutBat=%USERPROFILE%\Desktop\Start_ComfyUI.bat"
273
+ echo @echo off > "!shortcutBat!"
274
+ echo cd /d "%comfyPath%" >> "!shortcutBat!"
275
+ echo call "%venvPath%\Scripts\activate.bat" >> "!shortcutBat!"
276
+ echo python main.py >> "!shortcutBat!"
277
+ echo pause >> "!shortcutBat!"
278
+ echo Shortcut created on Desktop as Start_ComfyUI.bat
279
+ )
280
+
281
+ REM -------------------------------
282
+ REM Ask to start ComfyUI
283
+ REM -------------------------------
284
+ echo Would you like to start ComfyUI now?
285
+ echo [Y] Yes
286
+ echo [N] No
287
+ set /p "STARTNOW=Choose [Y/N]: "
288
+ if /i "!STARTNOW!"=="Y" (
289
+ echo Starting ComfyUI...
290
+ "%pythonPath%" "%comfyPath%\main.py"
291
+ )
292
+
293
+ pause