@echo off

echo WARNING. For this auto installer to work you need to have installed Python 3.10.x, Git, CUDA 12.4, cudNN 8.9, FFmpeg and C++ tools 
echo Follow this tutorial step by step to install above requirements : https://youtu.be/DrhUHnYfwC0

pip install requests

git clone https://github.com/C0untFloyd/roop-unleashed

cd roop-unleashed

REM Create virtual environment folder
echo composing venv
py --version >nul 2>&1
if "%ERRORLEVEL%" == "0" (
    echo Python launcher is available. Generating Python 3.10 VENV
    py -3.10 -m venv venv
) else (
    echo Python launcher is not available, generating VENV with default Python. Make sure that it is 3.10
    python -m venv venv
)
call .\venv\Scripts\activate.bat

echo installing requirements 
REM Install packages from requirements.txt
pip install -r requirements.txt

pip uninstall torchaudio torchvision torch --yes
pip install torch==2.5.1 xformers==0.0.28.post3 torchaudio torchvision --index-url https://download.pytorch.org/whl/cu124
pip install onnxruntime-gpu==1.20.1

REM Show completion message
echo Virtual environment made and installed properly

REM Pause to keep the command prompt open
pause