@echo off

echo WARNING. For this auto installer to work you need to have installed Python 3.10.11 or 3.10.13 and C++ tools 
echo follow this tutorial : https://youtu.be/-NjNy7afOQ0

pip install requests
pip install tqdm
git lfs install

git clone https://github.com/FurkanGozukara/CodeFormer CodeFormerSE

cd CodeFormerSE

git clone https://github.com/sczhou/CodeFormer

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

pip install tqdm

pip install -r requirements.txt

echo installing requirements 

cd CodeFormer

python basicsr/setup.py develop

pip install torch==2.1.0 torchvision==0.16.0 --index-url https://download.pytorch.org/whl/cu118 --upgrade
pip install https://huggingface.co/MonsterMMORPG/SECourses/resolve/main/triton-2.1.0-cp310-cp310-win_amd64.whl
pip install xformers==0.0.22.post7
pip install bitsandbytes==0.43.0 --upgrade

REM Show completion message
echo Virtual environment made and installed properly

REM Pause to keep the command prompt open
pause