-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
54 lines (45 loc) · 2.67 KB
/
Copy pathstart.bat
File metadata and controls
54 lines (45 loc) · 2.67 KB
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
@echo off
REM ImageForge — Windows RTX launcher (CUDA)
REM =========================================
REM Targets: Windows 10/11 + RTX 2000 Ada (or any CUDA GPU)
REM Run this script from the repo root in a normal Command Prompt or PowerShell.
REM It creates/reuses a .venv, installs the console extras, and launches the app.
REM
REM PyTorch + CUDA must be installed separately (see NOTE below) before first run.
REM
REM NOTE: Install PyTorch for CUDA 12.x once, before running this script:
REM pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
REM (Check https://pytorch.org/get-started/locally/ for the current CUDA version.)
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
REM ── locate repo root (directory containing this script) ──────────────────
set "REPO_ROOT=%~dp0"
if "%REPO_ROOT:~-1%"=="\" set "REPO_ROOT=%REPO_ROOT:~0,-1%"
REM ── venv path (override with IMAGEFORGE_VENV env var) ────────────────────
if not defined IMAGEFORGE_VENV (
set "IMAGEFORGE_VENV=%REPO_ROOT%\.venv"
)
echo [imageforge] Repo root : %REPO_ROOT%
echo [imageforge] Venv : %IMAGEFORGE_VENV%
REM ── create venv if absent ────────────────────────────────────────────────
if not exist "%IMAGEFORGE_VENV%\Scripts\python.exe" (
echo [imageforge] Creating venv ...
python -m venv "%IMAGEFORGE_VENV%"
if errorlevel 1 (
echo ERROR: python -m venv failed. Is Python 3.11+ on PATH?
exit /b 1
)
)
REM ── activate ─────────────────────────────────────────────────────────────
call "%IMAGEFORGE_VENV%\Scripts\activate.bat"
REM ── install / update the console extras ──────────────────────────────────
echo [imageforge] Installing/updating imageforge[console] ...
pip install -e "%REPO_ROOT%.[console]" --quiet
if errorlevel 1 (
echo ERROR: pip install failed.
exit /b 1
)
REM ── set CUDA device ──────────────────────────────────────────────────────
set DEVICE=cuda
REM ── launch ───────────────────────────────────────────────────────────────
echo [imageforge] Launching console (DEVICE=cuda) ...
python -m imageforge.console.app %*