Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 20 additions & 34 deletions Windows/launcher.bat
Original file line number Diff line number Diff line change
@@ -1,67 +1,52 @@
@echo off
setlocal enabledelayedexpansion

REM URL du référentiel GitHub que vous souhaitez cloner
set github_repo_url=https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

REM Nom du dossier dans lequel vous souhaitez cloner le référentiel
set github_repo_name=sd-webui


REM URL du fichier Python que vous souhaitez télécharger
set python_download_url=https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe

REM Chemin de destination pour le téléchargement de Python
set python_repo_name=python_3_10_6


set git_repo_name=PortableGit


REM Installer la version Python 3.10.6 de Python
powershell -Command "Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force"

if not exist "%python_repo_name%" (
mkdir %python_repo_name%

REM Téléchargez Python (version spécifique)
echo Téléchargement de Python 3.10.6
echo Download Python 3.10.6
curl -o "%python_repo_name%\python_3.10.6.exe" "%python_download_url%"

cls

echo Téléchargement de Python 3.10.6
echo Download Python 3.10.6
start /wait /b %python_repo_name%/python_3.10.6.exe PrependPath=1 CompileAll=1 TargetDir="%cd%\%python_repo_name%" /quiet

REM Supprimez le fichier d'installation de Python si vous le souhaitez
del %python_repo_name%/python_3.10.6.exe

REM Ensure pip
start /wait /b %python_repo_name%/python.exe -m ensurepip
cls
start /wait /b %python_repo_name%/python.exe -m pip install requests
cls
start /wait /b %python_repo_name%/python.exe -m pip install PILLOW

cls
)


REM Installe une version Portable de Git si l'utilisateur n'a pas Git d'installé
git --version >nul 2>&1
if not %errorlevel% equ 0 (
REM Créer le répertoire pour Git

if not exist "%git_repo_name%" (

if not exist "./utils/7z.exe" (
REM Télécharger 7z
echo Installation de 7z
echo 7z installation
powershell -File "./utils/install-7z.ps1"

cls
)

mkdir %git_repo_name%

REM Télécharge et Décompresse Git
echo Installation de Git
echo Git installation
powershell -File "./utils/install-git.ps1"

cls
Expand All @@ -72,13 +57,18 @@ if not %errorlevel% equ 0 (
cls
)

REM Cloner le repo ou le Mettre à jour
if not exist "%github_repo_name%" (
REM Clonez le référentiel GitHub
echo Telechargement de Stable Diffusion

echo Download Stable Diffusion
start /wait /b ./%git_repo_name%/bin/git.exe clone %github_repo_url% %github_repo_name%

echo Download model
powershell -File "./utils/install-model.ps1"
cls

echo Download Lora
move ".\utils\Lora" ".\%github_repo_name%\models"*
cls

(
echo @echo off
echo set PYTHON=%cd%\python_3_10_6\python
Expand All @@ -93,23 +83,21 @@ if not %errorlevel% equ 0 (
) > process.bat

) else (
REM Mettre à jour Stable Diffusion
cd %github_repo_name%
start /wait /b ../%git_repo_name%/bin/git.exe pull
cd ../
)
) else (

if not exist "%github_repo_name%" (
REM Clonez le référentiel GitHub
echo Téléchargement de Stable Diffusion
echo Download Stable Diffusion
git clone %github_repo_url% %github_repo_name%

echo Téléchargement du modèle
echo Download model
powershell -File "./utils/install-model.ps1"
cls

echo Téléchargement du Lora
echo Download Lora
move ".\utils\Lora" ".\%github_repo_name%\models"
cls

Expand All @@ -125,7 +113,6 @@ if not %errorlevel% equ 0 (
echo call webui.bat
) > process.bat
) else (
REM Mettre à jour Stable Diffusion
cd %github_repo_name%
git pull
cd ../
Expand All @@ -137,7 +124,6 @@ set PYTHONUNBUFFERED=1

%cd%/%python_repo_name%/python.exe app.py

REM Désactivez l'extension delayedexpansion
endlocal

exit