stable-diffusion-webui/webui.cmd

64 lines
1.7 KiB
Batchfile
Raw Normal View History

@echo off
2022-09-15 00:38:52 +03:00
:: Run all commands using this script's directory as the working directory
cd %~dp0
2022-09-15 00:38:52 +03:00
:: copy over the first line from environment.yaml, e.g. name: ldm, and take the second word after splitting by ":" delimiter
for /F "tokens=2 delims=: " %%i in (environment.yaml) DO (
set v_conda_env_name=%%i
goto EOL
)
:EOL
echo Environment name is set as %v_conda_env_name% as per environment.yaml
2022-09-15 00:38:52 +03:00
:: Put the path to conda directory in a file called "custom-conda-path.txt" if it's installed at non-standard path
IF EXIST custom-conda-path.txt (
FOR /F %%i IN (custom-conda-path.txt) DO set v_custom_path=%%i
)
2022-09-15 00:38:52 +03:00
set v_paths=%ProgramData%\miniconda3
set v_paths=%v_paths%;%USERPROFILE%\miniconda3
set v_paths=%v_paths%;%ProgramData%\anaconda3
set v_paths=%v_paths%;%USERPROFILE%\anaconda3
for %%a in (%v_paths%) do (
IF NOT "%v_custom_path%"=="" (
set v_paths=%v_custom_path%;%v_paths%
)
)
2022-09-15 00:38:52 +03:00
for %%a in (%v_paths%) do (
if EXIST "%%a\Scripts\activate.bat" (
SET v_conda_path=%%a
echo anaconda3/miniconda3 detected in %%a
2022-09-15 00:38:52 +03:00
goto :CONDA_FOUND
)
)
2022-09-15 00:38:52 +03:00
IF "%v_conda_path%"=="" (
echo anaconda3/miniconda3 not found. Install from here https://docs.conda.io/en/latest/miniconda.html
2022-09-15 00:38:52 +03:00
pause
exit /b 1
)
2022-09-15 00:38:52 +03:00
:CONDA_FOUND
Dev merge (#819) * #715 #699 #698 #663 #625 #617 #611 #604 (#716) * Update README.md * Add sampler name to metadata (#695) Co-authored-by: EliEron <example@example.com> * old-dev-merge Co-authored-by: EliEron <subanimehd@gmail.com> Co-authored-by: EliEron <example@example.com> * img2img-fix (#717) * Revert "img2img-fix (#717)" This reverts commit 70d4b1ca2a27ff6e67aada0a47cb02670adfe056. * img2img fixes * Revert "img2img fixes" This reverts commit e66eddc6217d37deaa5e3086366a6f208a688969. * Revert "Revert "img2img-fix (#717)"" This reverts commit bf08b617d4fc97551cd9f264556b2e875e54b831. * img2img fixed * - Removed duplicated calls to save_sample. - Change variables and arguments to be more self-explanatory and easier to understand what they do. * Moved streamlit files to their proper location, before they were incorrectly added to the repository root folder. * Added retry dependency for the streamlit version. * Added .cmd file for easy running and updating the streamlit version of the UI. * Removed duplicated entry for streamlit on the environment.yaml file. * Removed some unnecessary lines from the the webui_streamlit.cmd file. * add gfpgan folder to gitignore, auto gen by imglab * added placeholder text similar to gradio * added auto conversion for 4 channel PNG to RGB * fix: regex escape characters * Update Readme links to sd-webui when appropriate (#781) * Update link to sd-webui when appropriate * added LDSR instruction per devilismyfriend guide * fix: stack overflow during recursion call (#784) * Added option to set default sampler name from config file, will be useful for those wanting to change the default sampler and have it persist even when closing the UI and opening it again. * Added try and except block to handle basic errors like StopException which is raised by streamlit when you hit the stop button and KeyError which happens also when stopping the generation because it tries to check the model at the end which is not loaded at that time, this can be ignored and so thats the reason for the exception. * separate css to external file * Added "git pull" and "git stash" to the commands run by the cmd scripts when launching the UI, this should make it so people who use it can automatically update the code from the repo and be up to date without manually using those commands everytime. * resolve conflict with master Co-authored-by: EliEron <subanimehd@gmail.com> Co-authored-by: EliEron <example@example.com> Co-authored-by: ZeroCool <ZeroCool940711@users.noreply.github.com> Co-authored-by: ZeroCool940711 <alejandrogilelias940711@gmail.com> Co-authored-by: Hafiidz <3688500+Hafiidz@users.noreply.github.com> Co-authored-by: Thomas Mello <work.mello@gmail.com>
2022-09-08 13:41:04 +03:00
2022-09-15 00:38:52 +03:00
if not exist "z_version_env.tmp" (
:: first time running, we need to update
set AUTO=1
call "update_to_latest.cmd"
)
call "%v_conda_path%\Scripts\activate.bat" "%v_conda_env_name%"
:PROMPT
set SETUPTOOLS_USE_DISTUTILS=stdlib
IF EXIST "models\ldm\stable-diffusion-v1\model.ckpt" (
2022-09-15 00:38:52 +03:00
set PYTHONPATH=%~dp0
python scripts\relauncher.py
) ELSE (
2022-09-15 00:38:52 +03:00
echo Your model file does not exist! Place it in 'models\ldm\stable-diffusion-v1' with the name 'model.ckpt'.
pause
)