Skip to content

Instantly share code, notes, and snippets.

@w-e-w
Last active July 2, 2023 07:17
Show Gist options
  • Save w-e-w/a2fcb55c12f818c8b5bb00d15c0df0b3 to your computer and use it in GitHub Desktop.
Save w-e-w/a2fcb55c12f818c8b5bb00d15c0df0b3 to your computer and use it in GitHub Desktop.
One-Click Install AUTOMATIC1111 Stable-Diffusion-Webui for Windows 10/11 Nvidia GPU
@echo off
cd /d "%~dp0"
set PATH=%~dp0internal\git\cmd;%~dp0internal\python;%~dp0internal\python\Scripts;%PATH%
set TRANSFORMERS_CACHE=%~dp0internal\transformers-cache
if not exist "internal" mkdir "internal"
if not exist "internal\git" (
if not exist "internal\cache_downloads" mkdir "internal\cache_downloads"
if not exist "internal\cache_downloads\MinGit.zip" powershell -Command "Invoke-WebRequest 'https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.1/MinGit-2.41.0-64-bit.zip' -OutFile 'internal\cache_downloads\MinGit.zip'"
powershell -Command "Expand-Archive 'internal\cache_downloads\MinGit.zip' -DestinationPath 'internal\git'"
)
if not exist "webui" git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git --filter=blob:none "webui"
if not exist "internal\python" (
if not exist "internal\cache_downloads" mkdir "internal\cache_downloads"
if not exist "internal\cache_downloads\python-3.10.6-embed-amd64.zip" powershell -Command "Invoke-WebRequest 'https://www.python.org/ftp/python/3.10.6/python-3.10.6-embed-amd64.zip' -OutFile 'internal\cache_downloads\python-3.10.6-embed-amd64.zip'"
powershell -Command "Expand-Archive 'internal\cache_downloads\python-3.10.6-embed-amd64.zip' -DestinationPath 'internal\python'"
move "internal\python\python310._pth" "internal\python\python310.pth" > NUL
if not exist "internal\cache_downloads\get-pip.py" powershell -Command "Invoke-WebRequest 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'internal\cache_downloads\get-pip.py'"
python "internal\cache_downloads\get-pip.py"
python -m pip install virtualenv
)
if not exist "webui\venv" python -m virtualenv "webui\venv"
cd webui
call webui-user.bat
@echo off
cd /d "%~dp0"
set PATH=%~dp0internal\git\cmd;%~dp0internal\python;%~dp0internal\python\Scripts;%PATH%
set TRANSFORMERS_CACHE=%~dp0internal\transformers-cache
if not exist "internal" mkdir "internal"
if not exist "internal\git" (
if not exist "internal\cache_downloads" mkdir "internal\cache_downloads"
if not exist "internal\cache_downloads\MinGit.zip" powershell -Command "Invoke-WebRequest 'https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.1/MinGit-2.41.0-64-bit.zip' -OutFile 'internal\cache_downloads\MinGit.zip'"
powershell -Command "Expand-Archive 'internal\cache_downloads\MinGit.zip' -DestinationPath 'internal\git'"
)
if not exist "webui" git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git --filter=blob:none "webui"
git -C "%~dp0webui" pull 2>NUL
if %ERRORLEVEL% == 0 (
git -C "%~dp0webui" reset --hard
git -C "%~dp0webui" pull
)
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment