* add script for building comfyui desktop with nunchaku * add readme to the scripty * style: make linter happy * update * add dependencies opencv and insightface * update rst * update * update * update * switch to the nunchaku fork * update * add a workflow for the build * update the workflow * update * update workflow * update * update * commit * make linter happy * do not trigger ci for fork --------- Co-authored-by: Muyang Li <lmxyy1999@foxmail.com>
ComfyUI Desktop Windows Build Setup
This README provides instructions for setting up and running the Windows build script for ComfyUI Desktop.
Prerequisites
Visual Studio with C++ Support
Visual Studio 2019 or later with the Desktop C++ workload is required for node-gyp compilation. This is essential for building native Node.js modules.
Required Components:
- Visual Studio Community 2022 (17.12.1 or later)
- Desktop development with C++ workload
- MSVC v143 x64 Spectre-mitigated libraries (v14.42-17.12 or latest)
Installing Spectre-mitigated Libraries:
The Spectre-mitigated libraries are critical and must be installed separately:
- Open the Visual Studio Installer
- Click "Modify" on your Visual Studio 2022 Community installation
- Go to the "Individual Components" tab
- Search for "Spectre"
- Check the boxes for: "MSVC v143 - VS 2022 C++ x64/x86 Spectre-mitigated libs"
- Install the selected components
Note
: Without the Spectre-mitigated libraries, the build process will fail during native module compilation.
System Requirements
- Windows 10/11 (64-bit)
- Administrative privileges (required for some package installations)
- Git (for cloning repositories)
- Internet connection (for downloading dependencies)
Build Script Overview
The build_comfyui_desktop.cmd script automates the entire build process by:
- Installing Python 3.12 via winget
- Installing the
uvpackage manager - Installing Node Version Manager (NVM) for Windows
- Setting up Node.js 20.18.0
- Installing Yarn 4.5.0
- Cloning the ComfyUI Desktop repository
- Installing dependencies and building the application
- Configuring PyTorch with CUDA support and Nunchaku integration
Script Configuration
The script uses the following default versions (configurable at the top of the script):
set PYTHON_VERSION=3.12
set TORCH_VERSION=2.7
set NODE_VERSION=20.18.0
set YARN_VERSION=4.5.0
set NUNCHAKU_VERSION=1.0.0
set CUDA_PIP_INDEX=cu128
Important Notes
- Administrative Rights: The script requires admin privileges for installing global packages
- Python Path: The script assumes Python installs to
%LocalAppData%\Programs\Python\Python312\python.exe - NVM Path: Expects NVM to be installed at
%LocalAppData%\nvm - CUDA Support: Configured for CUDA 12.8 by default (cu128 index)
Build Output
Upon successful completion, the script will:
- Create a fully configured ComfyUI Desktop environment
- Generate NVIDIA-optimized builds with CUDA support
- Include Nunchaku acceleration support
- Produce ready-to-use application binaries
Troubleshooting
Common Issues:
-
"Module was compiled against a different Node.js version"
- Run:
npx electron-rebuildin the project directory
- Run:
-
Missing Spectre-mitigated libraries error
- Ensure you've installed the Spectre-mitigated libraries as described above
-
Permission denied errors
- Run Windows CMD as Administrator. Do not use PowerShell.
-
Python installation fails
- Manually install Python 3.12 from python.org or Microsoft Store. You can also try Anaconda or Miniconda.
Support
For detailed development information and additional troubleshooting, refer to the main ComfyUI Desktop README.md in the desktop project repository.