@echo off
echo ============================================
echo Installing dependencies for custom nodes
echo ============================================

REM Path to ComfyUI virtual environment Python
set VENV_PYTHON=.venv\Scripts\python.exe

if not exist custom_nodes (
    echo [ERROR] Folder 'custom_nodes' not found in this directory.
    pause
    exit /b
)

for /d %%D in (custom_nodes\*) do (
    if exist "%%D\requirements.txt" (
        echo Installing requirements for %%~nxD...
        "%VENV_PYTHON%" -m pip install -r "%%D\requirements.txt"
    )
)

echo Installing core ML dependencies...
"%VENV_PYTHON%" -m pip install diffusers transformers accelerate huggingface_hub

echo Done installing all dependencies!
pause
