@echo off setlocal REM Use VS 2022 (CUDA 12.8 supports MSVC 14.3x from VS 2022, not MSVC 14.5x from VS 2025) set "VSVARS=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" if not exist "%VSVARS%" ( echo [flux_ext] ERROR: VS 2022 vcvars64.bat not found exit /b 1 ) call "%VSVARS%" || exit /b 1 set DISTUTILS_USE_SDK=1 echo [flux_ext] Building PyTorch C++ extension with VS 2022 + CUDA 12.8... py -3.10 setup_ext.py install if errorlevel 1 ( echo [flux_ext] Build FAILED exit /b 1 ) echo [flux_ext] Build succeeded! flux_ext is now installed. echo [flux_ext] Restart ComfyUI to use the new torch.ops path.