⎗ ✓ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57@echo off setlocal enabledelayedexpansion :: 1. SET PYTHON PATH AND VERIFY VERSION set PYTHON_BIN=python echo [INFO] Checking Python Version... :: Checks if Python is in PATH and specifically version 3.10.11 %PYTHON_BIN% -c "import sys; exit(0) if sys.version_info[:3] == (3, 10, 11) else exit(1)" >nul 2>&1 if %errorlevel% neq 0 ( echo [ERROR] Python 3.10.11 not detected! echo. echo This script REQUIRES Python 3.10.11 specifically for DirectML compatibility. echo Download it here: https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe echo. echo If already installed, make sure you checked "Add Python to PATH" during setup or add it manually. pause exit /b ) else ( echo [INFO] Python 3.10.11 confirmed. ) :: 2. DEPENDENCY PROTECTION (Anti-Overwrite) echo [INFO] Checking package integrity... %PYTHON_BIN% -m pip install -r requirements.txt --quiet :: FORCED OVERWRITE: Ensures torch-directml remains the default backend :: This repairs the environment if an extension tried to install CUDA versions echo [INFO] Shielding Torch-DirectML against extension interference... %PYTHON_BIN% -m pip install torch-directml torchvision torchaudio sqlalchemy --upgrade --quiet :: 3. COMFYUI-MANAGER if not exist custom_nodes\ComfyUI-Manager ( echo [INFO] Installing ComfyUI-Manager for the first time... git clone https://github.com/ltdrdata/ComfyUI-Manager custom_nodes/ComfyUI-Manager ) :: 4. LAUNCH COMFYUI echo. echo ======================================================== echo INITIALIZING: DirectML echo VERSION: Python 3.10.11 echo MODE: --lowvram (Memory Optimized) echo ======================================================== echo. :: Arguments optimized for stability :: --use-quad-cross-attention can be used instead of --use-split-cross-attention, it saves memory but it's slower %PYTHON_BIN% main.py --directml --force-fp16 --lowvram --preview-method auto --use-split-cross-attention --auto-launch if %errorlevel% neq 0 ( echo. echo [CRASH] An error occurred. Check the logs above. pause )
Warning LINK You are about to visit a link which has been flagged with the above content warnings. Do you wish to continue? Continue Cancel