forked from lshqqytiger/stable-diffusion-webui-amdgpu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebui-user.bat
More file actions
67 lines (53 loc) · 2.36 KB
/
webui-user.bat
File metadata and controls
67 lines (53 loc) · 2.36 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
@echo off
setlocal enabledelayedexpansion
REM ============================================================
REM Stable Diffusion WebUI - AMD (DirectML) Launcher
REM GPU: AMD RX 9060 XT 16GB
REM Repo: lshqqytiger DirectML lineage (your fork)
REM ============================================================
set "ROOT=%~dp0"
cd /d "%ROOT%"
REM --- Ensure logs directory exists ---
if not exist "%ROOT%logs" (
mkdir "%ROOT%logs"
)
REM --- VENV / Python ---
REM Prefer local venv python. If missing, WebUI will create venv when running webui.bat.
set "VENV_DIR=venv"
set "PYTHON=%ROOT%%VENV_DIR%\Scripts\python.exe"
if not exist "%PYTHON%" (
echo [WARN] Python not found at: %PYTHON%
echo [INFO] If this is first run, launching webui.bat will create the venv.
)
REM ============================================================
REM AMD DirectML Recommended Flags (RX 9060 XT 16GB)
REM ============================================================
REM Core:
REM --use-directml : DirectML backend
REM --no-half-vae : Helps avoid SDXL/Pony VAE decode weirdness on some setups
REM --skip-torch-cuda-test : Prevent CUDA checks
REM Optional stability:
REM --disable-nan-check : Only if you still get NaNs/black images after UI upcast setting
REM VRAM modes:
REM --medvram : safer if you run heavy SDXL/Pony + ControlNet
REM --lowvram : last resort
REM ============================================================
REM ---- Choose VRAM mode: default / medvram / lowvram ----
set "VRAM_MODE=default"
set "COMMANDLINE_ARGS=--use-directml --no-half-vae --skip-torch-cuda-test"
if /I "%VRAM_MODE%"=="medvram" set "COMMANDLINE_ARGS=%COMMANDLINE_ARGS% --medvram"
if /I "%VRAM_MODE%"=="lowvram" set "COMMANDLINE_ARGS=%COMMANDLINE_ARGS% --lowvram"
REM If you still get NaNs after enabling Settings -> Optimizations -> Upcast cross-attention to float32,
REM uncomment the next line:
REM set "COMMANDLINE_ARGS=%COMMANDLINE_ARGS% --disable-nan-check"
REM --- Log launch ---
echo [%DATE% %TIME%] Launching with: %COMMANDLINE_ARGS%>> "%ROOT%logs\launch.log"
REM --- Launch ---
set "LOGFILE=%ROOT%webui_directml.log"
echo [INFO] Launching with args: %COMMANDLINE_ARGS% > "%LOGFILE%"
REM Use webui.bat for standard environment setup if python isn't present yet
if not exist "%PYTHON%" (
call webui.bat
exit /b
)
call "%PYTHON%" launch.py %COMMANDLINE_ARGS% >> "%LOGFILE%" 2>&1