Xeno443 commited on
Commit
9758e85
·
verified ·
1 Parent(s): 1c5c5a9

Upload 11 files

Browse files
runscripts/README_VERY_IMPORTANT_v2.txt ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ComfyUI portable environment enhanced edition https://huggingface.co/datasets/Xeno443
2
+ =============================================================================================================================
3
+ This ComfyUI portable version has been enhanced to include
4
+ * a portable Git, which is sometimes needed to download additional custom node components
5
+ * ComfyUI-Manager for easy custom node management
6
+ * Keeping Python v3.12.10 for maximum compatibility
7
+
8
+ Everything else is unchanged from the original ComfyUI portable.
9
+
10
+ The only thing your system needs are the Microsoft Visual C++ runtimes, but if you are not using a naked Windows install
11
+ it is very likely that you already have those. If you don't have them you can download them here:
12
+ ## Microsoft Visual C++ 2015-2022 Redistributable
13
+ https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022
14
+
15
+ The original startup bat files remain unchanged and as such will not be able to use Git if you don't have a system-wide install.
16
+ Use the "_v2" versions to make sure the portable environment is set up correctly.
17
+
18
+ Usage
19
+ =====
20
+ ## run_nvidia_gpu_v2.bat
21
+ This file sets up the necessary environment variables and launches ComfyUI
22
+
23
+ ## get-models.bat
24
+ On a fresh install you will be missing a few essential/popular models and this file will download them for you.
25
+
26
+ ## run_nvidia_gpu_v2_fast_fp16_accumulation.bat
27
+ Same as above but enables fast FP16 accumulation.
28
+
29
+ ## run_nvidia_gpu_v2_sageattn.bat
30
+ Starts ComfyUI with support for Sage Attention.
31
+ You first must install Sage Attention support!
32
+
33
+ ## run_nvidia_gpu_v2_flashattn.bat
34
+ Starts ComfyUI with support for Flash Attention.
35
+ You first must install Flash Attention support!
36
+
37
+ ## install_sageattn1.bat, install_sageattn2.bat, install_flashattn.bat
38
+ These install the corresponding versions of Sage or Flash Attention into the Python environment.
39
+ Only use this if you know what you are doing!
40
+
41
+ ## environment.bat
42
+ Starts a cmd.exe within the portable environment. You can use this to manually modify the embedded Python.
43
+ Only use this if you know what you are doing!
44
+
45
+ ## change-pytorch.bat
46
+ This allows you to switch to a different Pytorch version, or just reinstall the current one if you encounter issues.
47
+ Only use this if you know what you are doing!
runscripts/change-pytorch.bat ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ call environment.bat passive
3
+
4
+ REM ============================
5
+ REM PYTHON PATH AUTO-DETECTION
6
+ REM for comfy or webui portable
7
+ REM ============================
8
+
9
+ set PY_EMBEDDED=%~dp0python_embeded
10
+ set PY_SYSTEM=%~dp0system\python
11
+
12
+ if exist "%PY_EMBEDDED%\python.exe" (
13
+ pushd "%PY_EMBEDDED%"
14
+ echo Detected python.exe in python_embedded
15
+ ) else if exist "%PY_SYSTEM%\python.exe" (
16
+ pushd "%PY_SYSTEM%"
17
+ echo Detected python.exe in system\python
18
+ ) else (
19
+ echo ERROR: Could not find python.exe in:
20
+ echo %PY_EMBEDDED%
21
+ echo %PY_SYSTEM%
22
+ echo.
23
+ echo Please make sure one of these folders contains python.exe.
24
+ pause
25
+ exit /b 1
26
+ )
27
+
28
+ setlocal enabledelayedexpansion
29
+ :menu
30
+ cls
31
+ echo ========================================
32
+ echo PyTorch Installation Selector
33
+ echo ========================================
34
+ echo.
35
+ echo This batch will remove the currently installed
36
+ echo pytorch version and (re)install the current version
37
+ echo for the GPU type you are choosing.
38
+ echo.
39
+ echo WARNING! Only do this if you know what you are doing!
40
+ echo.
41
+ echo 1 ^) Install PyTorch for NVIDIA (CUDA 13.0)
42
+ echo 2 ^) Install PyTorch for NVIDIA (CUDA 12.8)
43
+ echo 3 ^) Install PyTorch for Intel (XPU)
44
+ REM echo 4 ^) Install PyTorch for AMD (ROCm) (experimental!)
45
+ echo X ^) Exit
46
+ echo.
47
+ set /p choice="Select an option (1-4): "
48
+
49
+ if "%choice%"=="1" goto install_nvidia130
50
+ if "%choice%"=="2" goto install_nvidia128
51
+ if "%choice%"=="3" goto install_intel
52
+ REM if "%choice%"=="4" goto install_amd
53
+ if "%choice%"=="X" exit /b
54
+
55
+ echo Invalid choice!
56
+ goto menu
57
+
58
+ :uninstall
59
+ echo.
60
+ echo Removing existing PyTorch installations...
61
+ .\python.exe -m pip uninstall -y torch torchvision torchaudio
62
+ echo ### Uninstall complete.
63
+ pause
64
+ goto :eof
65
+
66
+ :install_nvidia130
67
+ call :uninstall
68
+ echo ### Installing PyTorch for NVIDIA (CUDA 13.0) ...
69
+ .\python.exe -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130
70
+ goto finish
71
+
72
+ :install_nvidia128
73
+ call :uninstall
74
+ echo ### Installing PyTorch for NVIDIA (CUDA 12.8) ...
75
+ .\python.exe -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu128
76
+ goto finish
77
+
78
+ :install_intel
79
+ call :uninstall
80
+ echo ### Installing PyTorch for Intel (XPU)
81
+ .\python.exe -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/xpu
82
+ goto finish
83
+
84
+ :install_amd
85
+ call :uninstall
86
+ echo ### Installing PyTorch for AMD...
87
+ .\python.exe -m pip install --no-cache-dir https://repo.radeon.com/rocm/windows/rocm-rel-7.1.1/rocm_sdk_core-0.1.dev0-py3-none-win_amd64.whl
88
+ .\python.exe -m pip install --no-cache-dir https://repo.radeon.com/rocm/windows/rocm-rel-7.1.1/rocm_sdk_devel-0.1.dev0-py3-none-win_amd64.whl
89
+ .\python.exe -m pip install --no-cache-dir https://repo.radeon.com/rocm/windows/rocm-rel-7.1.1/rocm_sdk_libraries_custom-0.1.dev0-py3-none-win_amd64.whl
90
+ .\python.exe -m pip install --no-cache-dir https://repo.radeon.com/rocm/windows/rocm-rel-7.1.1/rocm-0.1.dev0.tar.gz
91
+ .\python.exe -m pip install --no-cache-dir https://repo.radeon.com/rocm/windows/rocm-rel-7.1.1/torch-2.9.0+rocmsdk20251116-cp312-cp312-win_amd64.whl
92
+ .\python.exe -m pip install --no-cache-dir https://repo.radeon.com/rocm/windows/rocm-rel-7.1.1/torchaudio-2.9.0+rocmsdk20251116-cp312-cp312-win_amd64.whl
93
+ .\python.exe -m pip install --no-cache-dir https://repo.radeon.com/rocm/windows/rocm-rel-7.1.1/torchvision-0.24.0+rocmsdk20251116-cp312-cp312-win_amd64.whl
94
+ goto finish
95
+
96
+ :finish
97
+ echo Done!
98
+ pause
runscripts/environment.bat ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ set DIR=%~dp0
3
+ ECHO Setting up portable environment using %DIR% ...
4
+ set PATH=%DIR%\git\bin;%DIR%\python_embeded;%DIR%\python_embeded\Scripts;%PATH%
5
+ set PY_LIBS=%DIR%\python_embeded\Scripts\Lib;%DIR%\python_embeded\Scripts\Lib\site-packages
6
+ set PY_PIP=%DIR%\python_embeded\Scripts
7
+ set PIP_INSTALLER_LOCATION=%DIR%\python\get-pip.py
8
+
9
+ if /I "%~1"=="passive" (
10
+ REM we just set the env vars and return
11
+ goto :EOF
12
+ )
13
+
14
+ ECHO.
15
+ ECHO ===================================================================
16
+ ECHO Use this command prompt to modify the embbedded Python environment.
17
+ ECHO ===================================================================
18
+ PUSHD python_embeded
19
+ cmd.exe
20
+ POPD
21
+ EXIT
runscripts/get-models.bat ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @ECHO OFF
2
+ call environment.bat passive
3
+ ECHO.
4
+ ECHO This script will download different models for Upscale, ADetailer and ControlNet.
5
+ PAUSE
6
+
7
+ ECHO Downloading popular Upscale models ...
8
+ IF NOT EXIST "webui\models\ESRGAN" MD "webui\models\ESRGAN"
9
+ curl --skip-existing -L "https://huggingface.co/datasets/Xeno443/reForge-portable/resolve/main/models/4x_NMKD-Siax_200k.pth" -o "ComfyUI\models\upscale_models\4x_NMKD-Siax_200k.pth"
10
+ curl --skip-existing -L "https://huggingface.co/datasets/Xeno443/reForge-portable/resolve/main/models/4x_foolhardy_Remacri.pth" -o "ComfyUI\models\upscale_models\4x_foolhardy_Remacri.pth"
11
+ curl --skip-existing -L "https://huggingface.co/datasets/Xeno443/reForge-portable/resolve/main/models/4x_Nickelback_70000G.pth" -o "ComfyUI\models\upscale_models\4x_Nickelback_70000G.pth"
12
+ curl --skip-existing -L "https://huggingface.co/datasets/Xeno443/reForge-portable/resolve/main/models/4x_Nomos8k-SC.pth" -o "ComfyUI\models\upscale_models\4xNomos8kSC.pth"
13
+ curl --skip-existing -L "https://huggingface.co/datasets/Xeno443/reForge-portable/resolve/main/models/1x_ReFocus-Cleanly.pth" -o "ComfyUI\models\upscale_models\1x_ReFocus-Cleanly.pth"
14
+ ECHO.
15
+
16
+ ECHO Downloading Detailer model ...
17
+ IF NOT EXIST "webui\models\adetailer" MD "webui\models\adetailer"
18
+ curl --skip-existing -L "https://huggingface.co/datasets/Xeno443/reForge-portable/resolve/main/models/fdetailerAdetailerFor_v11.pt" -o "models\ultralytics\segm\fdetailerAdetailerFor_v11.pt"
19
+ ECHO.
20
+
21
+ ECHO Downloading HAT Upscale model ...
22
+ IF NOT EXIST "webui\models\HAT" MD "webui\models\HAT"
23
+ curl --skip-existing -L "https://huggingface.co/datasets/Xeno443/reForge-portable/resolve/main/models/4x_Nomos8kSCHAT-L.pth" -o "ComfyUI\models\upscale_models\4x_Nomos8kSCHAT-L.pth"
24
+ ECHO.
25
+
26
+ ECHO Downloading ControlNet model ...
27
+ IF NOT EXIST "webui\models\ControlNet" MD "webui\models\ControlNet"
28
+ curl --skip-existing -L "https://huggingface.co/xinsir/controlnet-union-sdxl-1.0/resolve/main/diffusion_pytorch_model_promax.safetensors" -o "ComfyUI\models\controlnet\Union_sdxlv1_promax.safetensors"
29
+ ECHO.
30
+
31
+ ECHO If you don't have a base model downloaded yet, contine to download one. Otherwise close this window now.
32
+ PAUSE
33
+
34
+ ECHO.
35
+ ECHO Downloading 3WolfMondAI-SDG model ...
36
+ curl --skip-existing -L "https://huggingface.co/Xeno443/3wolfMondAI-SDG/resolve/main/3WolfMondAI-SDG.safetensors" -o "ComfyUI\models\checkpoints\3WolfMondAI-SDG.safetensors"
37
+ ECHO.
38
+
39
+ ECHO Done
40
+ pause
runscripts/install_flashattn.bat ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @ECHO OFF
2
+ CALL environment.bat passive
3
+ ECHO # FlashAttention2 install script
4
+ ECHO.
5
+ ECHO This will install Triton and FlashAttention 2.8.3 into the Python environment.
6
+ ECHO An Internet connection is required to download the necessary components.
7
+ PAUSE
8
+
9
+ set PYTHONUTF8=1
10
+ set PYTHONIOENCODING=utf-8
11
+ set PYTHON=python_embeded\python.exe
12
+
13
+ ECHO.
14
+ ECHO ### Installing Visual Studio Build Tools.
15
+ ECHO If you already have a compatible version, the update will read "Installer failed with exit code: 1". This is normal!
16
+ ECHO ====================================================================================================================
17
+ 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"
18
+
19
+ ECHO.
20
+ ECHO ### Installing Triton
21
+ ECHO =====================
22
+ %PYTHON% -s -m pip install triton-windows
23
+
24
+ ECHO.
25
+ ECHO ### Installing SageAttention
26
+ ECHO ============================
27
+ %PYTHON% -s -m pip install .\attnfiles\flash_attn-2.8.3+cu128torch2.8.0cxx11abiFALSE-cp312-cp312-win_amd64.whl
28
+
29
+ ECHO.
30
+ ECHO Installation complete ...
31
+ ECHO.
32
+ pause
runscripts/install_sageattn1.bat ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @ECHO OFF
2
+ CALL environment.bat passive
3
+ ECHO # SageAttention1 install script
4
+ ECHO.
5
+ ECHO This will install Triton and SageAttention 1.0.6 into the Python environment.
6
+ ECHO An Internet connection is required to download the necessary components.
7
+ PAUSE
8
+
9
+ set PYTHONUTF8=1
10
+ set PYTHONIOENCODING=utf-8
11
+ set PYTHON=python_embeded\python.exe
12
+
13
+ ECHO.
14
+ ECHO ### Installing Visual Studio Build Tools.
15
+ ECHO If you already have a compatible version, the update will read "Installer failed with exit code: 1". This is normal!
16
+ ECHO ====================================================================================================================
17
+ 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"
18
+
19
+ ECHO.
20
+ ECHO ### Installing Triton
21
+ ECHO =====================
22
+ %PYTHON% -s -m pip install triton-windows
23
+
24
+ ECHO.
25
+ ECHO ### Installing SageAttention
26
+ ECHO ============================
27
+ %PYTHON% -s -m pip install sageattention==1.0.6
28
+
29
+ ECHO.
30
+ ECHO Installation complete ...
31
+ ECHO.
32
+ pause
runscripts/install_sageattn2.bat ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @ECHO OFF
2
+ CALL environment.bat passive
3
+ ECHO # SageAttention2 install script
4
+ ECHO.
5
+ ECHO This will install Triton and SageAttention 2.2.0 into the Python environment.
6
+ ECHO An Internet connection is required to download the necessary components.
7
+ PAUSE
8
+
9
+ set PYTHONUTF8=1
10
+ set PYTHONIOENCODING=utf-8
11
+ set PYTHON=python_embeded\python.exe
12
+
13
+ ECHO.
14
+ ECHO ### Installing Visual Studio Build Tools.
15
+ ECHO If you already have a compatible version, the update will read "Installer failed with exit code: 1". This is normal!
16
+ ECHO ====================================================================================================================
17
+ 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"
18
+
19
+ ECHO.
20
+ ECHO ### Installing Triton
21
+ ECHO =====================
22
+ %PYTHON% -s -m pip install triton-windows
23
+
24
+ ECHO.
25
+ ECHO ### Installing SageAttention
26
+ ECHO ============================
27
+ %PYTHON% -s -m pip install .\attnfiles\sageattention-2.2.0+cu128torch2.9.0.post3-cp39-abi3-win_amd64.whl
28
+
29
+ ECHO Runnning test script ...
30
+ ECHO.
31
+ %PYTHON% .\attnfiles\test_sageattn.py
32
+
33
+ ECHO.
34
+ ECHO Installation complete ...
35
+ ECHO.
36
+ pause
runscripts/run_nvidia_gpu_v2.bat ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ @ECHO OFF
2
+ CALL environment.bat passive
3
+ ECHO # Modified startup bat
4
+ ECHO.
5
+ SET COMFYPARAMS=--windows-standalone-build
6
+ ECHO Starting ComfyUI with parameters "%COMFYPARAMS%" ...
7
+ .\python_embeded\python.exe -s ComfyUI\main.py %COMFYPARAMS%
8
+ PAUSE
runscripts/run_nvidia_gpu_v2_fast_fp16_accumulation.bat ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ @ECHO OFF
2
+ CALL environment.bat passive
3
+ ECHO # Modified startup v2 with fp16 fast accumulation
4
+ ECHO.
5
+ SET COMFYPARAMS=--windows-standalone-build --fast fp16_accumulation
6
+ ECHO Starting ComfyUI with parameters "%COMFYPARAMS%" ...
7
+ .\python_embeded\python.exe -s ComfyUI\main.py %COMFYPARAMS%
8
+ PAUSE
runscripts/run_nvidia_gpu_v2_flashattn.bat ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @ECHO OFF
2
+ CALL environment.bat passive
3
+ ECHO # Modified startup bat for FlashAttention support
4
+ ECHO.
5
+ ECHO Checking for FlashAttention installation...
6
+ .\python_embeded\python.exe -c "import flash_attn" >nul 2>&1
7
+ if %errorlevel%==0 (
8
+ ECHO FlashAttention module detected.
9
+ ) else (
10
+ .\python_embeded\python.exe -c "import flash_attn_2" >nul 2>&1
11
+ if %errorlevel%==0 (
12
+ ECHO FlashAttention module detected.
13
+ ) else (
14
+ ECHO WARNING: FlashAttention not found in the embedded Python environment.
15
+ ECHO You may need to install it manually.
16
+ pause
17
+ exit /b 1
18
+ )
19
+ )
20
+
21
+ SET COMFYPARAMS=--windows-standalone-build --use-flash-attention
22
+ ECHO Starting ComfyUI with parameters "%COMFYPARAMS%" ...
23
+ .\python_embeded\python.exe -s ComfyUI\main.py %COMFYPARAMS%
24
+ PAUSE
runscripts/run_nvidia_gpu_v2_sageattn.bat ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @ECHO OFF
2
+ CALL environment.bat passive
3
+ set SAGEATTN_DEBUG=1
4
+ ECHO # Modified startup bat for SageAttention support
5
+ ECHO.
6
+ ECHO Checking for SageAttention installation...
7
+ .\python_embeded\python.exe -c "import sageattention" >nul 2>&1
8
+ if %errorlevel%==0 (
9
+ ECHO SageAttention module detected.
10
+ ) else (
11
+ .\python_embeded\python.exe -c "import sage_attention" >nul 2>&1
12
+ if %errorlevel%==0 (
13
+ ECHO SageAttention module detected.
14
+ ) else (
15
+ ECHO WARNING: SageAttention not found in the embedded Python environment.
16
+ ECHO You may need to install it manually.
17
+ pause
18
+ exit /b 1
19
+ )
20
+ )
21
+
22
+ SET COMFYPARAMS=--windows-standalone-build --use-sage-attention
23
+ ECHO Starting ComfyUI with parameters "%COMFYPARAMS%" ...
24
+ .\python_embeded\python.exe -s ComfyUI\main.py %COMFYPARAMS%
25
+ PAUSE