Automated installation scripts for ComfyUI on Linux and Windows systems that handle everything from Python environment setup to custom node installation. These scripts provide a streamlined, dependency-conflict-free installation process with full control over package versions and installation steps.
- Automated Environment Setup: Installs pyenv, Python, and creates an isolated virtual environment
- Interactive Prompts: Collects ComfyUI version, optional managed frontend version, and alias name at runtime
- Version Control: Pin specific versions of ComfyUI, PyTorch, NumPy, Transformers, and other critical packages
- Optional Frontend Pinning: Pin a frontend per launcher or preserve a custom/existing frontend package
- GPU Acceleration: Supports CUDA 13.0, CUDA 12.8, CUDA 12.6, Linux ROCm 7.1, native Windows ROCm 7.2.1, and CPU-only installations
- Performance Optimization: Verifies exact Flash Attention wheels; attempts the latest SageAttention source with a matching CUDA toolchain and preserves verified installations when a rebuild fails
- Custom Node Collection: Automatically clones and configures 45 popular custom nodes
- Lowercase Cloning: Clones custom nodes with lowercase directory names to match ComfyUI-Manager convention
- Selective Installation: Choose which components to install via interactive menu
- Smart Dependency Management: Prevents version conflicts by enforcing package versions
- Per-Directory Sharing: Independently centralize models, input, output, user data, and custom_nodes
- Multi-Install Support: Run multiple ComfyUI versions side-by-side with per-version aliases and launchers
- Shell Integration: Adds user-chosen aliases (e.g.,
comfy2,comfy3) and retargets a selected name when it already exists - Automatic Alias Naming: Leaving the alias prompt empty selects
comfy, thencomfy1,comfy2, and so on - Multiple Shell Support: Auto-detects and configures bash, zsh, and fish shells
- Launch Arguments: Append configurable flags to every generated alias and launcher
- Operating System: Linux (Ubuntu, Debian, Fedora, Arch, openSUSE, etc.)
- Permissions: Sudo access for installing system dependencies
- Disk Space: ~10-20GB for full installation (varies with custom nodes)
- GPU (optional): NVIDIA GPU with CUDA support or an AMD GPU supported by the configured ROCm release
- Git: For cloning repositories
- Operating System: Windows 10 or Windows 11
- PowerShell: Version 5.1+ (included with Windows 10/11) or PowerShell 7+
- Disk Space: ~10-20GB for full installation
- GPU (optional): NVIDIA GPU with CUDA support, or an AMD GPU/APU in AMD's Windows ROCm support matrix
- AMD ROCm: Windows 11, Python 3.12, and AMD Software: PyTorch on Windows Edition driver 26.2.2 are required for ROCm 7.2.1
- Git: Git for Windows installed and in PATH (download)
- Visual Studio Build Tools, ninja, and a matching CUDA toolkit (optional): Required for attempting a SageAttention source build; SageAttention 1.0.6 is the fallback when it can be import-verified
# Download the script
git clone https://github.com/r-vage/ComfyUI-Installation-Script-for-Linux.git
cd ComfyUI-Installation-Script-for-Linux
# Make executable
chmod +x install_comfy_env.sh
# Run the script
./install_comfy_env.sh# Download the script
git clone https://github.com/r-vage/ComfyUI-Installation-Script-for-Linux.git
cd ComfyUI-Installation-Script-for-Linux
# Allow script execution (if not already enabled)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Run the script
.\install_comfy_env_win.ps1Note: The Windows script uses directory junctions (similar to symlinks) which work without Administrator privileges. If you need true symlinks, run PowerShell as Administrator.
The script will display your configuration and prompt you to select which installation steps to run.
Before running the script, you can customize these variables at the top of install_comfy_env.sh (Linux) or install_comfy_env_win.ps1 (Windows):
PYTHON_VERSION="3.12.10" # Python version (3.10.x, 3.11.x, 3.12.x, 3.13.x, 3.14.x recommended)
VENV_PATH="/mnt/data/AI/comfy_env" # Virtual environment location
PYENV_ROOT="${PYENV_ROOT:-$HOME/.pyenv}" # pyenv installation directoryWindows equivalent:
$PYTHON_VERSION = "3.12.10"β venv path defaults to$BASE_PATH\comfy_env(e.g.D:\AI\comfy_env)
Configured Python range: 3.10.x through 3.14.x. Individual binary packages have narrower matrices; notably, stable Nunchaku 1.2.1 provides wheels only for Python 3.10 through 3.13. The installers validate required wheel tags before installation.
PYTORCH_VERSION="2.10.0" # Base PyTorch version
PYTORCH_WHEEL_VARIANT="cu130" # CUDA, ROCm, or CPU wheel variantThe installers derive the wheel index URL and the matching TorchVision and TorchAudio versions automatically. Users do not need to look up or configure companion-package versions. Unsupported PyTorch releases stop with a clear message rather than installing a potentially ABI-incompatible stack.
Windows equivalent:
$PYTORCH_VERSION = "2.10.0"with$PYTORCH_WHEEL_VARIANT = "cu130"for NVIDIA. Native Windows AMD ROCm remains a separate configuration: PyTorch2.9.1withrocm7.2.1.
Current post-2.9 compatibility and wheel availability:
| PyTorch | TorchVision | TorchAudio | Linux variants | Windows variants |
|---|---|---|---|---|
2.9.1 |
0.24.1 |
2.9.1 |
cu126, cu128, cu130, cpu |
cu126, cu128, cu130, rocm7.2.1, cpu |
2.10.0 |
0.25.0 |
2.10.0 |
cu126, cu128, cu130, rocm7.1, cpu |
cu126, cu128, cu130, cpu |
2.11.0 |
0.26.0 |
2.11.0 |
cu126, cu128, cu130, rocm7.1, cpu |
cu126, cu128, cu130, cpu |
2.12.0 |
0.27.0 |
2.11.0 |
cu126, cu130, rocm7.1, cpu |
cu126, cu130, cpu |
2.12.1 |
0.27.1 |
2.11.0 |
cu126, cu130, rocm7.1, cpu |
cu126, cu130, cpu |
2.13.0 |
0.28.0 |
2.11.0 |
cu126, cu130, rocm7.1, cpu |
cu126, cu130, cpu |
TorchAudio 2.11.0 is its final release and is explicitly forward-compatible with newer Torch releases. The installers validate the selected version/channel pair before installation; notably, cu128 stops at PyTorch 2.11.0.
Available wheel channels:
Linux ROCm uses the PyTorch wheel index. Native Windows ROCm uses AMD's official SDK and framework wheels from repo.radeon.com, which the PowerShell installer resolves separately from the NVIDIA/CPU indexes.
- CUDA 13.0:
cu130(default) - CUDA 12.8:
cu128 - CUDA 12.6:
cu126 - ROCm 7.1:
rocm7.1(AMD GPUs on Linux) - ROCm 7.2.1:
rocm7.2.1(supported AMD GPUs/APUs on Windows 11) - CPU only:
cpu(no GPU)
Example CUDA 13.0 configuration:
PYTORCH_WHEEL_VARIANT="cu130"Example Linux ROCm 7.1 configuration (AMD GPUs):
PYTORCH_WHEEL_VARIANT="rocm7.1"Example native Windows ROCm 7.2.1 configuration:
$PYTORCH_VERSION = "2.9.1"
$PYTORCH_WHEEL_VARIANT = "rocm7.2.1"The Windows installer validates Windows 11 and Python 3.12, installs the official AMD ROCm 7.2.1 SDK and PyTorch wheels, disables NVIDIA-only Nunchaku and attention packages, and verifies a real HIP tensor operation. Install AMD driver 26.2.2 first and confirm the GPU or APU appears in AMD's Radeon or Ryzen support matrix.
Example CPU configuration:
PYTORCH_WHEEL_VARIANT="cpu"NUMPY_VERSION="2.2.6" # NumPy version (2.2.x for PyTorch 2.9+)
TRANSFORMERS_VERSION="5.3.0" # Transformers (5.x for Qwen3-VL/Mistral3)These versions are enforced at the end of installation to override any conflicting dependencies from custom nodes.
Both installers begin with a mode selector:
- Easy (default on Enter) asks only for the ComfyUI version, managed frontend version, and launcher name. This is the original three-question workflow.
- Advanced asks for the base path; Python, PyTorch, NumPy, and Transformers versions; hardware backend; ComfyUI and frontend policy; Nunchaku library policy; launcher name, arguments, and frontend pinning; and all five sharing policies.
- Skip questions loads the embedded defaults, prints the resolved configuration, and opens the numbered step selector immediately. For example, choose Skip and enter
9-11to rerun package enforcement and launcher setup without answering configuration questions.
Every prompt displays its embedded default. Press Enter to accept it. In Advanced mode, enter - to skip/ignore management for that setting and keep its installed state: the installer will not install, upgrade, enforce, remove, relink, regenerate, or save it. Dependent steps are labeled unavailable and are removed even when explicitly selected. A preserved base path still uses the embedded path to locate resources but is not saved.
Easy mode keeps the familiar prompts:
Configuration mode:
[E]asy (default)
[A]dvanced
[S]kip questions
Mode [E]:
ComfyUI version [0.37.0]:
Frontend version [1.53.6]:
Launch alias [comfy]:
The folder name is derived automatically: 0.37.0 becomes ComfyUI_0.37.0. An empty alias prompt checks existing profiles and launcher files, then suggests the first free name in comfy, comfy1, comfy2, and so on. Skip mode uses the embedded launcher default, currently comfy1 in both scripts. Entering an existing launcher name explicitly updates that alias or profile function to point to the selected ComfyUI installation.
Advanced hardware selection accepts NVIDIA, AMD/ROCm, CPU, or - on both platforms. NVIDIA accepts CUDA aliases such as 13, 13.0, and cu130. Linux AMD accepts configured ROCm aliases such as 7.1 and rocm7.1; Windows AMD accepts 7.2, 7.2.1, and rocm7.2.1. PyTorch shorthand such as 2.9 is normalized to the newest configured patch (2.9.1). The platform, Python, PyTorch, and backend combination is validated before any selected work starts.
After every successful Easy or Advanced run, the installer asks Save successful choices as new defaults? (y/N). Only managed answers whose related selected work succeeded are eligible. - answers and values for unselected steps keep their previous defaults. Easy saves only eligible ComfyUI, frontend, and alias answers. Skip never offers saving. Each installer rewrites only its own marked defaults block through a same-directory temporary candidate, parses the candidate, preserves file metadata, and atomically replaces the original. A read-only file or failed validation only emits a warning; the completed installation remains successful.
Frontend management and launcher pinning are separate. Disabling or preserving frontend management never uninstalls an existing package. Launcher files and profile functions pin the frontend only when both frontend management and launcher pinning are enabled. Linux launcher creation is entirely part of step 11, so selecting only steps 9-10 cannot rewrite it.
When sharing is enabled for a new installation, pristine checkout files are copied into an empty or missing shared location without overwriting existing shared files. A - sharing answer leaves the corresponding filesystem entry untouched. Existing divergent local and shared data are preserved for manual merging.
Multiple ComfyUI installations: run the installer again with another version and alias. All installations share the configured virtual environment; sharing choices decide whether models, input, output, user data, and custom nodes are shared or local.
SYMLINK_MODELS=true # Share models
SYMLINK_INPUT=true # Share input
SYMLINK_OUTPUT=true # Share output
SYMLINK_USER=true # Share settings, workflows, and templates
SYMLINK_CUSTOM_NODES=true # Share custom nodes
USER_MODELS_PATH="/mnt/data/AI/models" # Centralized models directory
USER_INPUT_PATH="/mnt/data/AI/input" # Centralized input directory
USER_OUTPUT_PATH="/mnt/data/AI/output" # Centralized output directory
USER_USERDATA_PATH="/mnt/data/AI/user" # Centralized user directory (settings, workflows, templates)
USER_CUSTOM_NODES_PATH="/mnt/data/AI/custom_nodes" # Centralized custom_nodes directoryWindows equivalent: use
$SYMLINK_MODELS,$SYMLINK_INPUT,$SYMLINK_OUTPUT,$SYMLINK_USER, and$SYMLINK_CUSTOM_NODESwith$true/$false. Paths default toD:\AI\models,D:\AI\input,D:\AI\output,D:\AI\user, andD:\AI\custom_nodes(using directory junctions instead of symlinks).
Symlinks allow you to:
- Share models across multiple ComfyUI installations
- Share input images across multiple ComfyUI installations
- Share custom nodes across multiple ComfyUI installations (useful when testing different ComfyUI versions)
- Share user data (frontend settings, saved workflows, node templates) across all versions β cross-version safe because
comfy.settings.jsonis merged against frontend defaults at runtime - Store models on a different drive/partition
- Keep outputs in a centralized location
Set any SYMLINK_* variable to false to keep that directory local. If an older run already created a link for a disabled path, the installer preserves it and prints removal instructions rather than detaching it automatically.
Migration is conservative: populated local data is copied only when the shared target is empty. If both directories contain data, both are preserved and the link is skipped until you merge them manually. A failed copy never causes the local directory to be removed.
Tip β directories outside
BASE_PATH: By default, the centralized paths (USER_MODELS_PATH,USER_INPUT_PATH,USER_OUTPUT_PATH,USER_USERDATA_PATH,USER_CUSTOM_NODES_PATH) are derived fromBASE_PATH. You can point any of them to a completely different location β for example a larger disk β by editing the "Derived Paths" section in the script:Linux:
USER_MODELS_PATH="/mnt/ssd2/models" # Models on a fast SSD USER_OUTPUT_PATH="/home/$USER/comfyui_output" # Output in home directory USER_USERDATA_PATH="/home/$USER/comfyui_user" # User data in home directoryWindows:
$USER_MODELS_PATH = "E:\models" # Models on drive E: $USER_OUTPUT_PATH = "C:\Users\$env:USERNAME\comfyui_out" # Output in user profileThe script creates the target directories automatically and symlinks/junctions them into the ComfyUI tree.
INSTALL_NUNCHAKU=true # Nunchaku acceleration (requires NVIDIA GPU)
INSTALL_MATCHING_CUDA_TOOLKIT=true # Install matching versioned CUDA build packages on Linux
INSTALL_COMFYUI_FRONTEND=true # Pin/install the configured frontend package
PIN_FRONTEND_VERSION_IN_ALIAS=false # Do not reinstall the frontend from the shell/profile alias
COMFYUI_LAUNCH_ARGS="--multi-user --disable-pinned-memory"COMFYUI_LAUNCH_ARGS is appended after python main.py in every generated alias and launcher. Set it to an empty string to launch without predefined flags. Arguments supplied when invoking a launcher are appended after these configured defaults.
INSTALL_NUNCHAKU controls only step 3's Nunchaku Python/CUDA acceleration library. The installers pin stable Nunchaku 1.2.1, derive its cu12.8 or cu13.0 wheel tag from the PyTorch channel, validate OS/Python/PyTorch/CUDA support, and install only the official GitHub wheel. They never fall back to the unrelated PyPI package and never clone or install the ComfyUI-Nunchaku custom node. ROCm and CPU configurations mark step 3 unavailable; explicitly selecting it prints a clear warning and leaves it disabled.
Step 8 treats compiled attention extensions as ABI-specific. Linux installs Flash Attention only when the exact official upstream wheel URL exists for the configured Python, Torch, and CUDA-12 stack, forces replacement of an older same-version wheel, and verifies both Flash Attention and Kornia imports. Windows removes Flash Attention because upstream does not publish a matching official Windows wheel. When Flash Attention is unavailable or broken, it is removed so ComfyUI can use PyTorch attention instead of failing during Kornia import.
On Linux, the latest SageAttention source is refreshed from the official upstream main branch and built only after the installer verifies a matching Torch/CUDA toolkit, nvcc, compiler, Ninja, supported GPU architecture, temporary disk space, and memory. This applies to every supported NVIDIA CUDA variant, including cu128 and cu130; SageAttention is not restricted to CUDA 13. When the selected PyTorch CUDA version changes, Step 8 automatically installs NVIDIA's matching versioned cuda-compiler-X-Y and cuda-libraries-dev-X-Y packages and prefers their side-by-side path, such as /usr/local/cuda-13.0, without uninstalling older toolkits or changing the system-wide /usr/local/cuda alternative. System package installation runs through sudo, so the user can enter a password directly in the console when required. This requires the NVIDIA CUDA package repository to already be configured and can be disabled in Advanced mode. The installer also isolates the source build from stale CUDA environment variables. PyTorch wheels continue to supply their own CUDA runtime and cuDNN libraries. A failed refresh retains an already-working SageAttention installation; if no usable installation remains after a failed toolkit check, compilation, or v2 smoke test, the installer uses the no-compile SageAttention 1.0.6 fallback. That fallback does not satisfy integrations such as the MiniMax H3 patch that explicitly require SageAttention 2. Windows follows the same source-refresh, verification, retention, and fallback policy, with platform-specific toolchain detection and best-effort native compilation (see the Windows troubleshooting section below).
Both installers bypass uv's cache for SageAttention source builds and disable dependency changes during the build. Git wheel caches identify the source commit, which can stay the same after a PyTorch upgrade; refreshing the source and reinstalling alone can reuse an incompatible native extension. After changing PyTorch, rerun steps 8,12 to rebuild and verify the attention libraries. A real source compilation can take several minutes.
ComfyUI-Manager-disabled nodes are preserved. Step 6 recognizes repositories moved into custom_nodes/.disabled/<node> and does not clone a second active copy. Step 7 never installs requirements from that quarantine folder or from legacy top-level <node>.disabled directories.
The script is divided into 12 steps that you can run selectively:
- Python Environment - pyenv, Python version, virtual environment
- PyTorch - compatible PyTorch, TorchVision, and TorchAudio stack for NVIDIA CUDA, Linux or Windows ROCm, or CPU
- Nunchaku - stable acceleration library only (optional, supported NVIDIA combinations only)
- Face Recognition - facexlib, insightface, onnxruntime-gpu, facenet_pytorch
- ComfyUI Core - ComfyUI base installation and requirements
- Custom Nodes - 45 popular custom nodes (see list below)
- Custom Node Dependencies - Install requirements for active custom nodes; Manager-disabled and legacy
.disablednodes are skipped - Performance Libraries - llama-cpp-python, verified official Flash Attention wheels, and a verified latest-source SageAttention build with a no-compile fallback
- Upgrade/Pin Packages - Upgrade selected direct packages without broadly upgrading already-compatible transitive runtime dependencies
- Enforce Versions - Force exact versions of PyTorch, NumPy, Transformers, ComfyUI Frontend
- Shell Aliases - Add user-chosen launch alias and
envactalias to shell config - Compatibility Audit/Repair - Run
uv pip check, apply conservative directional repairs, verify core imports, and report mutually incompatible custom-node requirements without forcing one legacy stack over the managed runtime
- ComfyUI_Eclipse - Extended toolkit with Smart LM subsystem
- ComfyUI_SmartModelLoader - Model loading, conditioning, and sampling workflows
- ComfyUI_SmartLLM - Language and vision models, tagging, and detection
- ComfyUI-Manager - Node manager
ComfyUI-GGUFandComfyUI-Florence2are supplied through Eclipse's external-node integration and are not cloned separately.
- ComfyUI-Crystools-MonitorOnly - System resource monitoring
- ComfyUI-Easy-Use - Simplified nodes
- ComfyUI_essentials - Essential utilities
- ComfyUI_essentials_mb - Additional essentials
- cg-image-filter - Image filter/selector
- WhatDreamsCost-ComfyUI - Free workflow and media-generation utilities
- Nvidia_RTX_Nodes_ComfyUI - NVIDIA RTX optimization nodes
- ComfyUI-TeaCache - Cache-based inference acceleration
- ComfyUI_Patches_ll - Performance patches
- RES4LYF - Advanced samplers, schedulers, and noise types (fork)
- sd-dynamic-thresholding - Dynamic CFG thresholding
- ComfyUI-Raffle - Semi-random prompt generator for danbooru tags (fork)
- SeedVarianceEnhancer - Adds diversity to Z-Image Turbo outputs
- ComfyUI-DyPE - Artifact-free 4K+ image generation
- comfyui-WhiteRabbit - White Rabbit nodes
- ComfyUI-Advanced-ControlNet - Advanced ControlNet features
- comfyui_controlnet_aux - ControlNet preprocessors
- ComfyUI-Impact-Pack - Image enhancement suite
- ComfyUI-Impact-Subpack - Impact Pack extensions
- ComfyUI_LayerStyle - Layer effects
- ComfyUI_LayerStyle_Advance - Advanced layer effects
- ComfyUI-Detail-Daemon - Detail enhancement
- ComfyUI-KJNodes - Various utilities
- ComfyUI_Fill-Nodes - Image, video, audio, file, and workflow utilities
- ComfyUI-TiledDiffusion - Tiled diffusion and VAE processing for large images
- ComfyUI-SUPIR - Super resolution
- ComfyUI_BiRefNet_ll - Background removal
- ComfyUI_PuLID_Flux_ll - Face ID for Flux (project fork)
- comfyui-krea2edit - Instruction-based Krea 2 image editing
- ComfyUI-Krea2T-Enhancer - Krea 2 prompt-adherence enhancement
- ComfyUI-SCAIL-Pose - Pose estimation
- ComfyUI-MMAudio - Multi-modal audio generation
- ComfyUI-MelBandRoFormer - Audio source separation
- comfyui-audio-expo - Audio export utilities
- ComfyUI-VideoHelperSuite - Video utilities
- ComfyUI-Frame-Interpolation - Video frame interpolation
- ComfyUI-GIMM-VFI - GIMM video frame interpolation
- ComfyUI-VFI - RIFE video frame interpolation
- ComfyUI-WanVideoWrapper - Wan video generation
- ComfyUI-WanAnimatePreprocess - Wan animate preprocessing
- ComfyUI-SeedVR2_VideoUpscaler - Video upscaling
- ComfyUI-LTXVideo - LTX video generation
Run the installer, choose Easy, Advanced, or Skip, then select numbered work:
./install_comfy_env.sh.\install_comfy_env_win.ps1The step selector accepts individual numbers, spaces or commas, inclusive ranges, and a for all available steps.
Examples:
- Easy + Enter keeps the original three-question defaults, then
ainstalls all available work. - Skip +
9-11proceeds directly to upgrade/pin, final enforcement, and launcher setup. 1 2 5sets up Python, PyTorch, and ComfyUI core.6-7clones custom nodes and installs their dependencies for an existing checkout.10only re-enforces settings that are managed; values entered as-stay untouched.12audits declared dependencies and runtime imports, repairs the known-safe runtime-package intersection, and reports irreconcilable custom-node constraints.- Selecting an unavailable dependent step prints its reason and removes it.
When step 1 is omitted, package work requires the configured virtual environment to exist. Steps that operate on a checkout likewise require step 5 or an existing configured ComfyUI directory. These checks run before confirmation.
After installation, you have several options (examples assume alias comfy2 and version 0.19.0):
Option 1: Launcher script (recommended)
/mnt/data/AI/start_comfy2.shOption 2: Shell alias (if Step 11 was run)
comfy2 # Activates the environment and launches ComfyUIOption 3: Manual
source /mnt/data/AI/comfy_env/bin/activate
cd /mnt/data/AI/ComfyUI_0.19.0
python main.pyOption 1: Double-click launcher
D:\AI\comfy2.bat
Option 2: PowerShell launcher
D:\AI\comfy2.ps1Option 3: PowerShell alias (if Step 11 was run, after reloading profile)
comfy2Option 4: Manual
& "D:\AI\comfy_env\Scripts\Activate.ps1"
cd "D:\AI\ComfyUI_0.19.0"
python main.pyWith INSTALL_COMFYUI_FRONTEND=true, each alias and launcher pins the configured frontend via uv pip install -q comfyui-frontend-package==VERSION (an instant no-op when already installed). With it disabled, launchers leave the current/custom frontend untouched. Both modes append COMFYUI_LAUNCH_ARGS to python main.py.
# Shared across all installations (Step 11)
envact
# Or manually
source /mnt/data/AI/comfy_env/bin/activateTo add/remove custom nodes, edit the [6/12] Clone Custom Nodes section around line 550:
# Add your custom node:
clone_if_missing "https://github.com/yourusername/your-custom-node.git"
# Remove a node by commenting it out or deleting the line:
# clone_if_missing "https://github.com/some/node-you-dont-want.git"Then run:
./install_comfy_env.shAnd select steps 6-7 to update custom nodes and their dependencies.
If pyenv dependencies fail to install, you may need to manually install build dependencies for your distribution:
Ubuntu/Debian:
sudo apt-get update
sudo apt-get install build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl git \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-devFedora:
sudo dnf install make gcc patch zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel xz-devel libuuid-devel gdbm-libs libnsl2Nunchaku and the compiled attention accelerators require an NVIDIA configuration with an exact compatible Python, Torch, CUDA, and platform combination. Missing Flash Attention is not fatal: the installers remove an ABI-incompatible extension and ComfyUI uses PyTorch attention. On Linux, a SageAttention preflight, source-build, or smoke-test failure preserves a working installation when possible and otherwise installs SageAttention 1.0.6 as a no-compile fallback. The fallback does not enable nodes that explicitly require SageAttention 2. Windows retains its separate pinned SageAttention policy described below.
If bz2 or another Python standard-library module cannot import, install the operating system development package and rebuild that Python version through pyenv. The installer reports this condition and never creates a library symlink workaround.
Run step 12 after installing custom-node dependencies. It uses uv pip check, repairs only known shared intersections, validates ComfyUI core imports, and lists conflicts it intentionally leaves unresolved. When installed generations disagreeβfor example, legacy inference packages versus current inference-cli, Hugging Face, or typing librariesβthe audit preserves the current managed runtime instead of minimizing the warning count with unsafe downgrades. Step 10 remains available to re-enforce explicitly managed package versions.
./install_comfy_env.sh # Select step 12, or 10-12After step 11, you need to reload your shell configuration:
# For bash
source ~/.bashrc
# For zsh
source ~/.zshrc
# For fish
source ~/.config/fish/config.fish
# Or just restart your terminalAfter step 11, reload your PowerShell profile:
. $PROFILE
# Or just restart PowerShellIf you get a script execution error:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserClose and reopen PowerShell. If still not found, ensure these are in your PATH:
%USERPROFILE%\.pyenv\pyenv-win\bin%USERPROFILE%\.pyenv\pyenv-win\shims
The Windows installer does not use community Flash Attention wheels or attempt a Flash Attention source build. It removes an incompatible installation and uses PyTorch attention. For SageAttention it attempts the latest official source when the CUDA, Visual C++, ninja, disk, and memory checks pass. It prefers the matching CUDA_PATH_V<major>_<minor> or standard versioned CUDA installation, restores the build environment afterward, and retains an existing installation only if it still passes verification. Install Windows CUDA development tools manually; automatic toolkit installation remains Linux-only.
Native Windows SageAttention compilation is best effort: the upstream build configuration includes Unix compiler flags, so passing preflight does not guarantee a successful MSVC build. If no verified installation remains, the script tries the no-compile 1.0.6 fallback without changing dependencies. That fallback still needs a working Triton runtime and does not provide SageAttention 2 integrations. A fallback that fails its import check is removed.
The full installation requires 10-20GB. To reduce space:
- Skip custom nodes (don't run step 6-7)
- Remove unused custom nodes manually from
custom_nodes/directory - Use symlinks to store models on a different drive
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes:
- Add new custom nodes to the installation list
- Update package versions
- Add support for new Linux distributions
- Improve error handling
- Test your changes on a fresh system if possible
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
When reporting issues, please include:
- Your Linux distribution and version
- Python version being installed
- Full error output
- Which installation step failed
This script is provided as-is for the ComfyUI community. Feel free to modify and distribute.
See CHANGELOG.md for the version history and recent changes.
- ComfyUI - The amazing stable diffusion GUI
- pyenv - Python version management (Linux)
- pyenv-win - Python version management (Windows)
- All the custom node developers for their incredible work
If you encounter issues:
- Check the Troubleshooting section
- Search existing Issues
- Open a new issue with detailed information
Happy ComfyUI-ing! π¨