-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_client_pair_example.cmd
More file actions
76 lines (62 loc) · 2.57 KB
/
Copy pathrun_client_pair_example.cmd
File metadata and controls
76 lines (62 loc) · 2.57 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@echo off
:: =============================================================================
:: run_client_pair_example.cmd : HAVC DiT paired inference launcher
::
:: Colorizes assets\sample1_bw.jpg and assets\sample2_bw.jpg in a single
:: inference pass (faster, temporally consistent).
::
:: Edit the USER CONFIGURATION block below before first use.
:: =============================================================================
:: ---------------------------------------------------------------------------
:: USER CONFIGURATION
:: ---------------------------------------------------------------------------
:: Path to python.exe
set PYTHON_EXE=%~dp0.venv\Scripts\python.exe
:: Directory containing dit_client_pair_example.py
set CLIENT_DIR=
:: Server host and port
set HOST=127.0.0.1
set PORT=8765
:: Text prompt
set PROMPT=Colorize this photo, natural skin tones, vibrant environment. Maintain consistency and details.
:: Separator width in pixels between the two images in the merged input
set GAP_PX=8
:: Number of inference steps
set STEPS=4
:: Shared memory transport (same-host only)
set USE_SHM=1
:: ---------------------------------------------------------------------------
:: RESOLVE PATHS
:: ---------------------------------------------------------------------------
if "%CLIENT_DIR%"=="" set CLIENT_DIR=%~dp0
if "%CLIENT_DIR:~-1%"=="\" set CLIENT_DIR=%CLIENT_DIR:~0,-1%
set CLIENT_SCRIPT=%CLIENT_DIR%\dit_client_pair_example.py
if not exist "%CLIENT_SCRIPT%" (
echo [ERROR] dit_client_pair_example.py not found in: %CLIENT_DIR%
pause
exit /b 1
)
:: ---------------------------------------------------------------------------
:: LAUNCH
:: ---------------------------------------------------------------------------
echo ============================================================
echo HAVC DiT Client : paired inference
echo Server : %HOST%:%PORT%
echo Input 1 : %CLIENT_DIR%\assets\sample1_bw.jpg
echo Input 2 : %CLIENT_DIR%\assets\sample2_bw.jpg
echo Output 1 : %CLIENT_DIR%\assets\sample1_colorized.jpg
echo Output 2 : %CLIENT_DIR%\assets\sample2_colorized.jpg
echo ============================================================
echo.
if "%USE_SHM%"=="1" (
"%PYTHON_EXE%" "%CLIENT_SCRIPT%" --host %HOST% --port %PORT% --prompt "%PROMPT%" --gap-px %GAP_PX% --steps %STEPS% --use-shm
) else (
"%PYTHON_EXE%" "%CLIENT_SCRIPT%" --host %HOST% --port %PORT% --prompt "%PROMPT%" --gap-px %GAP_PX% --steps %STEPS%
)
echo.
if %errorlevel%==0 (
echo [DONE] Paired colorization complete.
) else (
echo [ERROR] Client exited with code %errorlevel%.
)
pause