UmeAiRT commited on
Commit
4c61ed5
1 Parent(s): 3fb2b44

Add SD3.5 script

Browse files
ComfyUI-SD3.5-AllinOne-Auto_install.bat ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ setlocal enabledelayedexpansion
3
+
4
+ :CHOOSE_OPTION
5
+ REM Ask user for installation type
6
+ echo Choose your preferred installation:
7
+ echo A) Fast-Lowvram install
8
+ echo B) Unoptimized normal model
9
+ set /p "CHOICE=Enter your choice (A or B) and press Enter: "
10
+
11
+ if /i "%CHOICE%"=="A" (
12
+ set "INSTALL_TYPE=fast-lowvram"
13
+ ) else if /i "%CHOICE%"=="B" (
14
+ set "INSTALL_TYPE=unoptimized"
15
+ ) else (
16
+ echo Invalid choice. Please enter A or B.
17
+ goto CHOOSE_OPTION
18
+ )
19
+
20
+ :CHOOSE_FLUX_SCHNELL
21
+ REM Ask user if they want to download FLUX SCHNELL Model
22
+ echo Do you want to download SD3.5 Turbo model?
23
+ echo A) Yes
24
+ echo B) No
25
+ set /p "FLUX_SCHNELL_CHOICE=Enter your choice (A or B) and press Enter: "
26
+
27
+ if /i "%FLUX_SCHNELL_CHOICE%"=="A" (
28
+ set "DOWNLOAD_FLUX_SCHNELL=yes"
29
+ ) else if /i "%FLUX_SCHNELL_CHOICE%"=="B" (
30
+ set "DOWNLOAD_FLUX_SCHNELL=no"
31
+ ) else (
32
+ echo Invalid choice. Please enter A or B.
33
+ goto CHOOSE_FLUX_SCHNELL
34
+ )
35
+
36
+ :CHOOSE_FLUX_GGUF
37
+ REM Ask user if they want to download FLUX GGUF Model
38
+ echo Do you want to download SD3.5 GGUF models?
39
+ echo A) Q8_0 (24GB Vram)
40
+ echo B) Q5_0 (16GB Vram)
41
+ echo C) Q4_0 (less than 12GB Vram)
42
+ echo D) All
43
+ echo E) No
44
+ set /p "FLUX_GGUF_CHOICE=Enter your choice (A,B,C,D or E) and press Enter: "
45
+
46
+ if /i "%FLUX_GGUF_CHOICE%"=="A" (
47
+ set "DOWNLOAD_GGUF=yes"
48
+ ) else if /i "%FLUX_GGUF_CHOICE%"=="B" (
49
+ set "DOWNLOAD_GGUF=yes"
50
+ ) else if /i "%FLUX_GGUF_CHOICE%"=="C" (
51
+ set "DOWNLOAD_GGUF=yes"
52
+ ) else if /i "%FLUX_GGUF_CHOICE%"=="D" (
53
+ set "DOWNLOAD_GGUF=yes"
54
+ ) else if /i "%FLUX_GGUF_CHOICE%"=="E" (
55
+ set "DOWNLOAD_GGUF=no"
56
+ ) else (
57
+ echo Invalid choice. Please enter A,B,C,D or E.
58
+ goto CHOOSE_FLUX_GGUF
59
+ )
60
+
61
+ REM Check if 7-Zip is installed and get its path
62
+ for %%I in (7z.exe) do set "SEVEN_ZIP_PATH=%%~$PATH:I"
63
+ if not defined SEVEN_ZIP_PATH (
64
+ if exist "%ProgramFiles%\7-Zip\7z.exe" (
65
+ set "SEVEN_ZIP_PATH=%ProgramFiles%\7-Zip\7z.exe"
66
+ ) else if exist "%ProgramFiles(x86)%\7-Zip\7z.exe" (
67
+ set "SEVEN_ZIP_PATH=%ProgramFiles(x86)%\7-Zip\7z.exe"
68
+ ) else (
69
+ echo 7-Zip is not installed. Downloading and installing...
70
+ curl -L -o 7z-installer.exe https://www.7-zip.org/a/7z2201-x64.exe
71
+ 7z-installer.exe /S
72
+ set "SEVEN_ZIP_PATH=%ProgramFiles%\7-Zip\7z.exe"
73
+ if not exist "%SEVEN_ZIP_PATH%" (
74
+ echo Installation of 7-Zip failed. Please install it manually and try again.
75
+ exit /b 1
76
+ )
77
+ del 7z-installer.exe
78
+ )
79
+ )
80
+
81
+ REM Check and install Git
82
+ git --version > NUL 2>&1
83
+ if %errorlevel% NEQ 0 (
84
+ echo Installing Git...
85
+ 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 }}"
86
+ if %errorlevel% NEQ 0 (
87
+ echo Failed to download Git installer.
88
+ exit /b
89
+ )
90
+ start /wait Git-2.41.0.3-64-bit.exe /VERYSILENT
91
+ del Git-2.41.0.3-64-bit.exe
92
+ ) else (
93
+ echo Git already installed.
94
+ )
95
+
96
+ REM Download ComfyUI
97
+ echo Downloading ComfyUI...
98
+ curl -L -o ComfyUI_windows_portable_nvidia_cu121_or_cpu.7z https://github.com/comfyanonymous/ComfyUI/releases/download/latest/ComfyUI_windows_portable_nvidia_cu121_or_cpu.7z
99
+
100
+ REM Extract ComfyUI
101
+ echo Extracting ComfyUI...
102
+ "%SEVEN_ZIP_PATH%" x ComfyUI_windows_portable_nvidia_cu121_or_cpu.7z -o"%CD%" -y
103
+
104
+ REM Check if extraction was successful
105
+ if not exist "ComfyUI_windows_portable" (
106
+ echo Extraction failed. Please check the downloaded file and try again.
107
+ exit /b 1
108
+ )
109
+
110
+ REM Navigate to custom_nodes folder
111
+ cd ComfyUI_windows_portable\ComfyUI\custom_nodes
112
+
113
+ REM Clone ComfyUI-Manager
114
+ echo Cloning ComfyUI-Manager...
115
+ git clone https://github.com/ltdrdata/ComfyUI-Manager.git
116
+
117
+ REM Navigate to models folder
118
+ cd ..\models
119
+
120
+ REM Download VAE file
121
+ echo Downloading VAE file...
122
+ cd vae
123
+ curl -L -o diffusion_pytorch_model.safetensors https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/models/vae/diffusion_pytorch_model.safetensors?download=true
124
+
125
+ cd ..
126
+
127
+ REM Download CLIP files
128
+ echo Downloading CLIP files...
129
+ cd clip
130
+ curl -L -o clip_l.safetensors https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/models/clip/clip_l.safetensors?download=true
131
+ curl -L -o clip_g.safetensors https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/models/clip/clip_g.safetensors?download=true
132
+ curl -L -o t5xxl_fp8_e4m3fn.safetensors https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/models/clip/t5xxl_fp8_e4m3fn.safetensors?download=true
133
+ curl -L -o t5xxl_fp16.safetensors https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/models/clip/t5xxl_fp16.safetensors?download=true
134
+
135
+ cd ..
136
+
137
+ REM Download UNET file based on user choice
138
+ echo Downloading checkpoints file...
139
+ cd checkpoints
140
+ curl -L -o sd3.5_medium.safetensors https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/models/checkpoints/sd3.5_medium.safetensors?download=true
141
+ if "%INSTALL_TYPE%"=="fast-lowvram" (
142
+ curl -L -o sd3.5_large_fp8_scaled.safetensors https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/models/checkpoints/sd3.5_large_fp8_scaled.safetensors?download=true
143
+ ) else (
144
+ curl -L -o sd3.5_large.safetensors https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/models/checkpoints/sd3.5_large.safetensors?download=true
145
+ )
146
+
147
+ if "%DOWNLOAD_GGUF%"=="yes" (
148
+ echo Downloading SD3.5 GGUF Model...
149
+ if /i "%FLUX_GGUF_CHOICE%"=="A" (
150
+ curl -L -o sd3.5_large-Q8_0.gguf https://huggingface.co/city96/stable-diffusion-3.5-large-gguf/resolve/main/sd3.5_large-Q8_0.gguf?download=true
151
+ ) else if /i "%FLUX_GGUF_CHOICE%"=="B" (
152
+ curl -L -o sd3.5_large-Q5_0.gguf https://huggingface.co/city96/stable-diffusion-3.5-large-gguf/resolve/main/sd3.5_large-Q5_0.gguf?download=true
153
+ ) else if /i "%FLUX_GGUF_CHOICE%"=="C" (
154
+ curl -L -o sd3.5_large-Q4_0.gguf https://huggingface.co/city96/stable-diffusion-3.5-large-gguf/resolve/main/sd3.5_large-Q4_0.gguf?download=true
155
+ ) else if /i "%FLUX_GGUF_CHOICE%"=="D" (
156
+ curl -L -o sd3.5_large-Q8_0.gguf https://huggingface.co/city96/stable-diffusion-3.5-large-gguf/resolve/main/sd3.5_large-Q8_0.gguf?download=true
157
+ curl -L -o sd3.5_large-Q5_0.gguf https://huggingface.co/city96/stable-diffusion-3.5-large-gguf/resolve/main/sd3.5_large-Q5_0.gguf?download=true
158
+ curl -L -o sd3.5_large-Q4_0.gguf https://huggingface.co/city96/stable-diffusion-3.5-large-gguf/resolve/main/sd3.5_large-Q4_0.gguf?download=true
159
+ )
160
+ )
161
+
162
+ REM Download FLUX SCHNELL Model if user chose to
163
+ if "%DOWNLOAD_FLUX_SCHNELL%"=="yes" (
164
+ echo Downloading SD3.5 Turbo model...
165
+ curl -L -o sd3.5_large_turbo.safetensors https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/models/checkpoints/sd3.5_large_turbo.safetensors?download=true
166
+ )
167
+
168
+ cd ..
169
+
170
+ REM Download upscale model
171
+ echo Downloading upscale models...
172
+ cd upscale_models
173
+ curl -L -o 4x_NMKD-Siax_200k.pth https://huggingface.co/uwg/upscaler/resolve/main/ESRGAN/4x_NMKD-Siax_200k.pth?download=true
174
+ curl -L -o 4x-ClearRealityV1.pth https://huggingface.co/skbhadra/ClearRealityV1/resolve/main/4x-ClearRealityV1.pth?download=true
175
+
176
+ cd ..\..
177
+
178
+ mkdir .\user\default
179
+ echo Downloading comfy settings...
180
+ cd user\default
181
+ curl -L -o comfy.settings.json https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/others/comfy.settings.json?download=true
182
+ echo Downloading comfy workflow...
183
+ mkdir .\workflows
184
+ cd workflows
185
+ curl -L -o "UmeAiRT - Flux workflow.7z" https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/workflows/UmeAiRT-Flux_workflow.7z?download=true
186
+ "%SEVEN_ZIP_PATH%" x "UmeAiRT - Flux workflow.7z" -o"%CD%" -y >nul 2>&1
187
+ del /f "UmeAiRT - Flux workflow.7z" -force >nul 2>&1
188
+ cd ..\..\..\..
189
+
190
+ cd ComfyUI
191
+ cd custom_nodes
192
+ mkdir ComfyUI-NAI-styler
193
+ cd ComfyUI-NAI-styler
194
+ mkdir CSV
195
+ cd CSV
196
+ curl -L -o "naifilters.csv" https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/others/naifilters.csv?download=true
197
+ curl -L -o "naistyles.csv" https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/others/naistyles.csv?download=true
198
+ curl -L -o "naitypes.csv" https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/others/naitypes.csv?download=true
199
+
200
+ cd ..\..\..\..
201
+
202
+ REM Final steps based on user choice
203
+ if "%INSTALL_TYPE%"=="fast-lowvram" (
204
+ echo Downloading special run file for fast-lowvram...
205
+ curl -L -o "run_nvidia_gpu-LOWVRAM.bat" "https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/scripts/run_nvidia_gpu-LOWVRAM.bat?download=true"
206
+ echo ComfyUI and FLUX installed. Running ComfyUI...
207
+ call "run_nvidia_gpu-LOWVRAM.bat"
208
+ ) else (
209
+ echo ComfyUI and FLUX installed. HAVE FUN ;)
210
+ )