CivArchive
    ComfyUI for Linux & Windows - Linux & Windows
    Preview 126294971

    ComfyUI Installation Script for Linux & Windows

    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.

    🌟 Features

    • Automated Environment Setup: Installs pyenv, Python, and creates an isolated virtual environment

    • Interactive Prompts: Collects ComfyUI version, frontend version, and alias name at runtime

    • Version Control: Pin specific versions of ComfyUI, PyTorch, NumPy, Transformers, and other critical packages

    • Frontend Pinning: Each alias/launcher auto-installs the correct frontend version on launch

    • GPU Acceleration: Supports CUDA 13.0, CUDA 12.8, CUDA 12.6, ROCm 7.1, and CPU-only installations

    • Performance Optimization: Includes optional Nunchaku, Flash Attention, and Sage Attention

    • 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

    • Symlink Support: Centralize models and outputs across multiple installations

    • 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) with non-destructive, additive handling

    • Multiple Shell Support: Auto-detects and configures bash, zsh, and fish shells

    📋 Prerequisites

    Linux

    • 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 for acceleration features

    • Git: For cloning repositories

    Windows

    • 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 for acceleration features

    • Git: Git for Windows installed and in PATH (download)

    • Visual Studio Build Tools (optional): Required only if building packages from source (e.g., flash-attn)

    🚀 Quick Start

    Linux

    # 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
    

    Windows

    # 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.ps1
    

    Note: 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.

    ⚙️ Configuration

    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 Configuration

    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/daten/AI/comfy_env"  # Virtual environment location
    PYENV_ROOT="${PYENV_ROOT:-$HOME/.pyenv}"  # pyenv installation directory
    

    Windows equivalent: $PYTHON_VERSION = "3.12.10" — venv path defaults to $BASE_PATH\comfy_env (e.g. D:\AI\comfy_env)

    Recommended Python versions: 3.10.x, 3.11.x, 3.12.x, 3.13.x, 3.14.x have prebuilt wheels for PyTorch, Nunchaku, and Flash Attention. Other versions will require compilation from source.

    PyTorch Configuration

    PYTORCH_VERSION="2.9"             # PyTorch major.minor for wheel URLs
    PYTORCH_FULL_VERSION="2.9.1+cu128" # Full version string
    PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cu128"  # Wheel repository
    

    Available options:

    • CUDA 13.0: cu130 (latest)

    • CUDA 12.8: cu128 (default)

    • CUDA 12.6: cu126

    • ROCm 7.1: rocm7.1 (AMD GPUs)

    • CPU only: cpu (no GPU)

    Example CUDA 13.0 configuration:

    PYTORCH_FULL_VERSION="2.9.1+cu130"
    PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cu130"
    

    Example ROCm 7.1 configuration (AMD GPUs):

    PYTORCH_FULL_VERSION="2.9.1+rocm7.1"
    PYTORCH_INDEX_URL="https://download.pytorch.org/whl/rocm7.1"
    

    Example CPU configuration:

    PYTORCH_FULL_VERSION="2.9.1+cpu"
    PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
    

    Critical Package Versions

    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.

    ComfyUI Installation (Interactive)

    When you run the script, it prompts for three values:

    Enter values for this installation (press Enter for defaults):
    
      ComfyUI version [0.18.0]:     # → clones/checks out this tag (e.g., v0.18.2)
      Frontend version [1.41.21]:   # → pinned in aliases and launchers
      Launch alias [comfyui]:       # → shell alias name (e.g., comfy2, comfy3)
    

    The folder name is derived automatically: version 0.18.2ComfyUI_0.18.2.

    Static configuration (Python, PyTorch, NumPy, Transformers) stays at the top of the script and rarely changes.

    Multiple ComfyUI Installations:
    Simply run the script again with different values at the prompts:

    # First run:   version 0.18.0, alias comfyui   → /mnt/data/AI/ComfyUI_0.18.0
    # Second run:  version 0.18.2, alias comfy2     → /mnt/data/AI/ComfyUI_0.18.2
    # Third run:   version 0.19.0, alias comfy3     → /mnt/data/AI/ComfyUI_0.19.0
    

    Each installation gets its own alias and launcher script (start_comfy2.sh, start_comfy3.bat).
    All installations share the same venv, models, output, and custom nodes via symlinks.
    The envact alias is always shared (one venv for all installs).

    CREATE_SYMLINKS=true                # Enable/disable symlink creation
    USER_MODELS_PATH="/mnt/daten/AI/models"  # Centralized models directory
    USER_OUTPUT_PATH="/mnt/daten/AI/output"  # Centralized output directory
    USER_CUSTOM_NODES_PATH="/mnt/daten/AI/custom_nodes"  # Centralized custom_nodes directory
    

    Windows equivalent: $CREATE_SYMLINKS = $true — paths default to D:\AI\models, D:\AI\output, D:\AI\custom_nodes (uses directory junctions instead of symlinks)

    Symlinks allow you to:

    • Share models across multiple ComfyUI installations

    • Share custom nodes across multiple ComfyUI installations (useful when testing different ComfyUI versions)

    • Store models on a different drive/partition

    • Keep outputs in a centralized location

    Set CREATE_SYMLINKS=false to use default ComfyUI/models, ComfyUI/output, and ComfyUI/custom_nodes directories.

    Tip — directories outside BASE_PATH:
    By default, USER_MODELS_PATH, USER_OUTPUT_PATH, and USER_CUSTOM_NODES_PATH are derived from BASE_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
    

    Windows:

    $USER_MODELS_PATH = "E:\models"                         # Models on drive E:
    $USER_OUTPUT_PATH = "C:\Users\$env:USERNAME\comfyui_out" # Output in user profile
    

    The script creates the target directories automatically and symlinks/junctions them into the ComfyUI tree.

    Optional Features

    INSTALL_NUNCHAKU=true               # Nunchaku acceleration (requires NVIDIA GPU)
    

    Set to false to skip Nunchaku installation if you don't have an NVIDIA GPU or don't need this optimization.

    📦 What Gets Installed

    Installation Steps

    The script is divided into 11 steps that you can run selectively:

    1. Python Environment - pyenv, Python version, virtual environment

    2. PyTorch - PyTorch, torchvision, torchaudio with CUDA/CPU support

    3. Nunchaku - Acceleration library (optional, NVIDIA GPU only)

    4. Face Recognition - facexlib, insightface, onnxruntime-gpu, facenet_pytorch

    5. ComfyUI Core - ComfyUI base installation and requirements

    6. Custom Nodes - 45+ popular custom nodes (see list below)

    7. Custom Node Dependencies - Install requirements for all custom nodes

    8. Performance Libraries - llama-cpp-python, flash-attn, sageattention

    9. Upgrade/Pin Packages - Upgrade specific packages to latest compatible versions

    10. Enforce Versions - Force exact versions of PyTorch, NumPy, Transformers, ComfyUI Frontend

    11. Shell Aliases - Add user-chosen launch alias and envact alias to shell config

    Custom Nodes Included (45 nodes)

    Core Extensions

    UI & Workflow Tools

    Model Support & Optimization

    Sampling & Scheduling

    ControlNet & Advanced Control

    Image Processing & Effects

    Specialized Models

    Video Processing

    🎯 Usage

    Interactive Installation

    Run the script and select steps interactively:

    ./install_comfy_env.sh
    

    You'll see a menu:

    Select installation steps (numbers, ranges, or 'a' for all — e.g., 6-10 or 1 5 6-8):
      1) Python environment (pyenv + venv)
      2) PyTorch and base dependencies
      ...
      a) All steps (default)
    
    Your selection [a]:
    

    Examples:

    • a - Install everything (default)

    • 1 2 5 - Only setup Python, PyTorch, and ComfyUI core

    • 6-7 - Only clone and setup custom nodes (if you already have ComfyUI)

    • 5 9-11 - ComfyUI core + upgrade/pin/aliases

    • 10 - Only enforce package versions (useful after manual package changes)

    Running ComfyUI

    After installation, you have several options (examples assume alias comfy2 and version 0.18.2):

    Linux

    Option 1: Launcher script (recommended)

    /mnt/data/AI/start_comfy2.sh
    

    Option 2: Shell alias (if Step 11 was run)

    comfy2    # Auto-installs correct frontend, activates env, launches ComfyUI
    

    Option 3: Manual

    source /mnt/data/AI/comfy_env/bin/activate
    cd /mnt/data/AI/ComfyUI_0.18.2
    python main.py
    

    Windows

    Option 1: Double-click launcher

    D:\AI\start_comfy2.bat
    

    Option 2: PowerShell launcher

    D:\AI\start_comfy2.ps1
    

    Option 3: PowerShell alias (if Step 11 was run, after reloading profile)

    comfy2
    

    Option 4: Manual

    & "D:\AI\comfy_env\Scripts\Activate.ps1"
    cd "D:\AI\ComfyUI_0.18.2"
    python main.py
    

    Each alias and launcher automatically pins the correct frontend version via uv pip install -q comfyui-frontend-package==VERSION (instant no-op when already installed).

    Activating Virtual Environment Only

    # Shared across all installations (Step 11)
    envact
    
    # Or manually
    source /mnt/data/AI/comfy_env/bin/activate
    

    🔧 Customizing Custom Nodes

    To add/remove custom nodes, edit the [6/10] 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.sh
    

    And select steps 6-7 to update custom nodes and their dependencies.

    🐛 Troubleshooting

    pyenv Installation Fails

    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-dev
    

    Fedora:

    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 libnsl2
    

    Nunchaku or Flash Attention Installation Fails

    These require:

    • NVIDIA GPU

    • CUDA 12.6+ or compatible version

    • Prebuilt wheels for your Python version

    If you don't have an NVIDIA GPU, set INSTALL_NUNCHAKU=false and skip step 3.

    Custom Node Dependencies Conflict

    If a custom node installs incompatible package versions, run step 10 to enforce configured versions:

    ./install_comfy_env.sh  # Select step 10 only
    

    Shell Aliases Not Working

    Linux

    After 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 terminal
    

    Windows

    After step 11, reload your PowerShell profile:

    . $PROFILE
    
    # Or just restart PowerShell
    

    Windows: Execution Policy Error

    If you get a script execution error:

    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
    

    Windows: pyenv-win Not Found After Installation

    Close and reopen PowerShell. If still not found, ensure these are in your PATH:

    • %USERPROFILE%\.pyenv\pyenv-win\bin

    • %USERPROFILE%\.pyenv\pyenv-win\shims

    Windows: Flash Attention Not Available

    Flash Attention rarely has prebuilt Windows wheels. You can either:

    • Skip it (it's optional — ComfyUI works fine without it)

    • Install Visual Studio Build Tools and compile from source

    • Use Sage Attention as an alternative

    Out of Disk Space

    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


    Happy ComfyUI-ing! 🎨

    Version 0.8.2

    • since im not using windows anymore there will be no further updates for the portable versions 🤷🏻.

    • pyTorch 2.9+cu128

    • python: 3.12.10

    • Frontend: 1.36.13

    • removed crystools -> replaced with crystools-monitor only

    • Even though some API imports have been fixed, the deprecated messages are still displayed.

    • the reason for adding the forked versions instead of the originals is that some of the nodes are currently not working with the latest comfyui version.

    Additional Installed Libs

    • triton 3.51.1

    • llama_cpp_python 0.3.16

    • flash attention 2 (v2.8.3+torch2.9+cu128-cp312)

    • nunchaku-1.0.2+torch2.9-cp312-cp312

    • sage attention 2.2.0

    • transformers==4.56.2

    • insightface, facexlib, facenet_pytorch, comfy-cli, bitsandbytes, tensorflow, hf_xet, requests, pilgram, tf-keras, setuptools_scm, qwen-vl-utils, huggingface-hub, accelerate, Pillow, opencv-python, safetensors, psutil, PyYAML, aiohttp, av, gguf, ultralytics, pytorch-extension

    • python headers for torch compile/triton

    Installed Custom Nodes

    • comfy-mtb

    • comfyui_birefnet_ll

    • comfyui_controlnet_aux

    • ComfyUI_Eclipse 1.2.1

    • comfyui_essentials

    • comfyui_essentials_mb

    • comfyui_layerstyle

    • ComfyUI_LayerStyle_Advance

    • ComfyUI_Patches_ll (forked and fixed Imports)

    • comfyui_pulid_flux_ll

    • comfyui_ttp_toolset

    • comfyui-advanced-controlnet

    • ComfyUI-Crystools-MonitorOnly (forked and fixed small error in browser log)

    • ComfyUI-Custom-Scripts (forked and fixed API Imports)

    • comfyui-detail-daemon

    • comfyui-easy-use

    • comfyui-florence2

    • comfyui-frame-interpolation

    • ComfyUI-GGUF

    • ComfyUI-GIMM-VFI

    • comfyui-impact-pack

    • comfyui-kjnodes

    • ComfyUI-Manager (removed the anoying fetch msg output)

    • ComfyUI-nunchaku (forked and fixed Imports)

    • ComfyUI-ReActor

    • comfyui-supir

    • ComfyUI-TeaCache (forked and fixed Imports)

    • comfyui-videohelpersuite

    • ComfyUI-WanVideoWrapper

    • raffle

    • RES4LYF (forked and partially fixed (community pull requests))

    • rgthree-comfy (forked and fixed API Imports)

    • sd-dynamic-thresholding

    • was-ns

    Version 0.3.75

    (You will see some warnings from various nodes because the authors of comfyui are changing the API. -> [DEPRECATION WARNING])

    Additional Installed Libs

    • triton 3.51.1

    • llama_cpp_python 0.3.16

    • flash attention 2 (v2.8.3+torch2.9+cu128-cp312)

    • nunchaku-1.0.2+torch2.9-cp312-cp312

    • sage attention 2.2.0

    • transformers==4.56.2

    • facenet_pytorch, pytorch-extension, facexlib, insightface, comfy-cli, bitsandbytes, tensorflow, hf_xet, requests, pilgram, tf-keras, nvidia-ml-py

    • python headers for torch compile/triton

    Installed Custom Nodes

    • comfy-mtb

    • comfyui_birefnet_ll

    • comfyui_controlnet_aux

    • ComfyUI_Eclipse (1.0.60)

    • comfyui_essentials

    • ComfyUI_essentials_mb

    • comfyui_layerstyle

    • ComfyUI_LayerStyle_Advance

    • comfyui_patches_ll

    • comfyui_pulid_flux_ll

    • comfyui_ttp_toolset

    • comfyui-advanced-controlnet

    • ComfyUI-Crystools

    • comfyui-custom-scripts

    • comfyui-depthanythingv2

    • comfyui-detail-daemon

    • comfyui-easy-use

    • comfyui-florence2

    • comfyui-frame-interpolation

    • ComfyUI-GGUF

    • ComfyUI-GIMM-VFI

    • comfyui-impact-pack

    • comfyui-impact-subpack

    • comfyui-inspire-pack

    • comfyui-jdcn

    • comfyui-kjnodes

    • ComfyUI-Manager

    • comfyui-multigpu

    • ComfyUI-nunchaku

    • comfyui-reactor

    • comfyui-supir

    • comfyui-videohelpersuite

    • ComfyUI-WanMoeKSampler

    • ComfyUI-WanVideoWrapper

    • facerestore_cf

    • raffle

    • RES4LYF

    • rgthree-comfy

    • sd-dynamic-thresholding

    • sdxl_prompt_styler

    • teacache

    • was-ns

    • whiterabbit

    Description

    • updated both: Linux and Window with interactive prompting for versions and alias

    • updated to support installation step ranges e.g. 6-10

    • the archive contains both versions

    Other
    Other

    Details

    Downloads
    24
    Platform
    CivitAI
    Platform Status
    Available
    Created
    4/3/2026
    Updated
    4/5/2026
    Deleted
    -

    Files

    comfyuiForLinux_linuxWindows.zip

    Mirrors

    comfyuiForLinux_linuxWindows.zip

    Mirrors