mirror of
https://github.com/sd-webui/stable-diffusion-webui.git
synced 2024-12-15 15:22:55 +03:00
* Update environment on startup always * Message to explicitly state no environment.yaml update required Co-authored-by: hlky <106811348+hlky@users.noreply.github.com> Co-authored-by: Brian Semrau <brian.semrau@gmail.com> Co-authored-by: hlky <106811348+hlky@users.noreply.github.com>
This commit is contained in:
parent
4a8cc9ba6d
commit
1af2610c71
@ -36,25 +36,26 @@ IF "%v_conda_path%"=="" (
|
|||||||
echo Stashing local changes and pulling latest update...
|
echo Stashing local changes and pulling latest update...
|
||||||
call git stash
|
call git stash
|
||||||
call git pull
|
call git pull
|
||||||
echo If you want to restore changes you made before updating, run "git stash pop".
|
set /P restore="Do you want to restore changes you made before updating? (Y/N): "
|
||||||
call "%v_conda_path%\Scripts\activate.bat"
|
IF /I "%restore%" == "N" (
|
||||||
|
echo Removing changes please wait...
|
||||||
for /f "delims=" %%a in ('git log -1 --format^="%%H" -- environment.yaml') DO set v_cur_hash=%%a
|
call git stash drop
|
||||||
set /p "v_last_hash="<"z_version_env.tmp"
|
echo Changes removed, press any key to continue...
|
||||||
echo %v_cur_hash%>z_version_env.tmp
|
pause >nul
|
||||||
|
) ELSE IF /I "%restore%" == "Y" (
|
||||||
echo Current environment.yaml hash: %v_cur_hash%
|
echo Restoring changes, please wait...
|
||||||
echo Previous environment.yaml hash: %v_last_hash%
|
call git stash pop --quiet
|
||||||
|
echo Changes restored, press any key to continue...
|
||||||
if "%v_last_hash%" == "%v_cur_hash%" (
|
pause >nul
|
||||||
echo environment.yaml unchanged. dependencies should be up to date.
|
|
||||||
echo if you still have unresolved dependencies, delete "z_version_env.tmp"
|
|
||||||
if not defined AUTO pause
|
|
||||||
) else (
|
|
||||||
echo environment.yaml changed. updating dependencies
|
|
||||||
call conda env create --name "%v_conda_env_name%" -f environment.yaml
|
|
||||||
call conda env update --name "%v_conda_env_name%" -f environment.yaml
|
|
||||||
if not defined AUTO pause
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for /f "delims=" %%a in ('git log -1 --format^="%%H" -- environment.yaml') DO set v_cur_hash=%%a
|
||||||
|
echo %v_cur_hash%>z_version_env.tmp
|
||||||
|
|
||||||
|
call conda env create --name "%v_conda_env_name%" -f environment.yaml
|
||||||
|
call conda env update --name "%v_conda_env_name%" -f environment.yaml
|
||||||
|
if not defined AUTO pause
|
||||||
|
|
||||||
|
call "%v_conda_path%\Scripts\activate.bat"
|
||||||
|
|
||||||
::cmd /k
|
::cmd /k
|
||||||
|
@ -52,6 +52,24 @@ if not exist "z_version_env.tmp" (
|
|||||||
|
|
||||||
call "%v_conda_path%\Scripts\activate.bat" "%v_conda_env_name%"
|
call "%v_conda_path%\Scripts\activate.bat" "%v_conda_env_name%"
|
||||||
|
|
||||||
|
set v_last_hash=0
|
||||||
|
set /p "v_last_hash="<"z_version_env.tmp"
|
||||||
|
for /f "delims=" %%a in ('git log -1 --format^="%%H" -- environment.yaml') DO set v_cur_hash=%%a
|
||||||
|
|
||||||
|
if not "%v_last_hash%" == "%v_cur_hash%" (
|
||||||
|
set /P updateenv="Do you want to update with the latest environment.yaml? (Y/N): "
|
||||||
|
if /I "%updateenv%" == "N" (
|
||||||
|
echo Starting without updating dependencies.
|
||||||
|
) else if /I "%updateenv%" == "Y" (
|
||||||
|
echo Updating dependencies...
|
||||||
|
call conda env create --name "%v_conda_env_name%" -f environment.yaml
|
||||||
|
call conda env update --name "%v_conda_env_name%" -f environment.yaml
|
||||||
|
echo %v_cur_hash%>z_version_env.tmp
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
echo No environment.yaml update required.
|
||||||
|
)
|
||||||
|
|
||||||
:PROMPT
|
:PROMPT
|
||||||
set SETUPTOOLS_USE_DISTUTILS=stdlib
|
set SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||||
IF EXIST "models\ldm\stable-diffusion-v1\model.ckpt" (
|
IF EXIST "models\ldm\stable-diffusion-v1\model.ckpt" (
|
||||||
|
18
webui.cmd
18
webui.cmd
@ -52,6 +52,24 @@ if not exist "z_version_env.tmp" (
|
|||||||
|
|
||||||
call "%v_conda_path%\Scripts\activate.bat" "%v_conda_env_name%"
|
call "%v_conda_path%\Scripts\activate.bat" "%v_conda_env_name%"
|
||||||
|
|
||||||
|
set v_last_hash=0
|
||||||
|
set /p "v_last_hash="<"z_version_env.tmp"
|
||||||
|
for /f "delims=" %%a in ('git log -1 --format^="%%H" -- environment.yaml') DO set v_cur_hash=%%a
|
||||||
|
|
||||||
|
if not "%v_last_hash%" == "%v_cur_hash%" (
|
||||||
|
set /P updateenv="Do you want to update with the latest environment.yaml? (Y/N): "
|
||||||
|
if /I "%updateenv%" == "N" (
|
||||||
|
echo Starting without updating dependencies.
|
||||||
|
) else if /I "%updateenv%" == "Y" (
|
||||||
|
echo Updating dependencies...
|
||||||
|
call conda env create --name "%v_conda_env_name%" -f environment.yaml
|
||||||
|
call conda env update --name "%v_conda_env_name%" -f environment.yaml
|
||||||
|
echo %v_cur_hash%>z_version_env.tmp
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
echo No environment.yaml update required.
|
||||||
|
)
|
||||||
|
|
||||||
:PROMPT
|
:PROMPT
|
||||||
set SETUPTOOLS_USE_DISTUTILS=stdlib
|
set SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||||
IF EXIST "models\ldm\stable-diffusion-v1\model.ckpt" (
|
IF EXIST "models\ldm\stable-diffusion-v1\model.ckpt" (
|
||||||
|
Loading…
Reference in New Issue
Block a user