From 4f7ea60a2e93cd2b37af079ebc5025d96ab1764c Mon Sep 17 00:00:00 2001 From: Matt Soucy Date: Mon, 12 Sep 2022 04:41:47 -0400 Subject: [PATCH] Use the webui script directories as PWD (#946) --- webui-streamlit.cmd | 7 +++++-- webui.cmd | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/webui-streamlit.cmd b/webui-streamlit.cmd index cc8cff7..1b0f44a 100644 --- a/webui-streamlit.cmd +++ b/webui-streamlit.cmd @@ -1,5 +1,8 @@ @echo off +:: Run all commands using this script's directory as the working directory +cd %~dp0 + :: copy over the first line from environment.yaml, e.g. name: ldm, and take the second word after splitting by ":" delimiter set /p first_line=< environment.yaml for /f "tokens=2 delims=:" %%i in ("%first_line%") do set untrimmed_conda_env_name=%%i @@ -26,7 +29,7 @@ for %%a in (%paths%) do ( ) ) -for %%a in (%paths%) do ( +for %%a in (%paths%) do ( if EXIST "%%a\Scripts\activate.bat" ( SET CONDA_PATH=%%a echo anaconda3/miniconda3 detected in %%a @@ -55,4 +58,4 @@ IF EXIST "models\ldm\stable-diffusion-v1\model.ckpt" ( python -m streamlit run scripts\webui_streamlit.py --theme.base dark ) ELSE ( ECHO Your model file does not exist! Place it in 'models\ldm\stable-diffusion-v1' with the name 'model.ckpt'. -) \ No newline at end of file +) diff --git a/webui.cmd b/webui.cmd index ac4d61f..3d8b3cb 100644 --- a/webui.cmd +++ b/webui.cmd @@ -1,5 +1,8 @@ @echo off +:: Run all commands using this script's directory as the working directory +cd %~dp0 + :: copy over the first line from environment.yaml, e.g. name: ldm, and take the second word after splitting by ":" delimiter set /p first_line=< environment.yaml for /f "tokens=2 delims=:" %%i in ("%first_line%") do set untrimmed_conda_env_name=%%i @@ -26,7 +29,7 @@ for %%a in (%paths%) do ( ) ) -for %%a in (%paths%) do ( +for %%a in (%paths%) do ( if EXIST "%%a\Scripts\activate.bat" ( SET CONDA_PATH=%%a echo anaconda3/miniconda3 detected in %%a @@ -55,4 +58,4 @@ IF EXIST "models\ldm\stable-diffusion-v1\model.ckpt" ( python scripts/relauncher.py ) ELSE ( ECHO Your model file does not exist! Place it in 'models\ldm\stable-diffusion-v1' with the name 'model.ckpt'. -) \ No newline at end of file +)