File size: 1,396 Bytes
1d117d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f74c37b
 
 
 
 
 
 
 
 
 
 
 
1d117d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@echo off
SET VENV_DIR=.venv

REM Check if .venv exists
IF NOT EXIST %VENV_DIR% (
    echo Creating virtual environment...
    python -m venv %VENV_DIR%
)

REM Activate the virtual environment
CALL %VENV_DIR%\Scripts\activate

REM Upgrade pip
echo Upgrading pip...
python -m pip install --upgrade pip

REM Install specific packages
echo Installing required packages...
pip install uv

REM Check GPU type
SET TORCH_URL=https://download.pytorch.org/whl/cpu
nvidia-smi >nul 2>&1
IF %ERRORLEVEL% EQU 0 (
    echo NVIDIA GPU detected
    SET TORCH_URL=https://download.pytorch.org/whl/cu124
    uv pip install xformers torch torchvision --index-url %TORCH_URL%
) ELSE (
    echo No compatible GPU detected, using CPU
    uv pip install torch torchvision --index-url %TORCH_URL%
)

REM Install additional requirements
IF EXIST requirements.txt (
    echo Installing additional requirements...
    uv pip install -r requirements.txt
) ELSE (
    echo requirements.txt not found, skipping...
)

REM Check for enhance-prompt argument
echo Checking for enhance-prompt argument...
echo %* | findstr /i /c:"--enhance-prompt" >nul
IF %ERRORLEVEL% EQU 0 (
    echo Installing ollama with winget...
    winget install --id ollama.ollama
    ollama pull deepseek-r1
)

REM Launch the script
echo Launching LightDiffusion...
python .\modules\user\pipeline.py %*

REM Deactivate the virtual environment
deactivate