Skip to content

Commit 4f7ea60

Browse files
authored
Use the webui script directories as PWD (#946)
1 parent ba63fd7 commit 4f7ea60

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

webui-streamlit.cmd

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
@echo off
22

3+
:: Run all commands using this script's directory as the working directory
4+
cd %~dp0
5+
36
:: copy over the first line from environment.yaml, e.g. name: ldm, and take the second word after splitting by ":" delimiter
47
set /p first_line=< environment.yaml
58
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 (
2629
)
2730
)
2831

29-
for %%a in (%paths%) do (
32+
for %%a in (%paths%) do (
3033
if EXIST "%%a\Scripts\activate.bat" (
3134
SET CONDA_PATH=%%a
3235
echo anaconda3/miniconda3 detected in %%a
@@ -55,4 +58,4 @@ IF EXIST "models\ldm\stable-diffusion-v1\model.ckpt" (
5558
python -m streamlit run scripts\webui_streamlit.py --theme.base dark
5659
) ELSE (
5760
ECHO Your model file does not exist! Place it in 'models\ldm\stable-diffusion-v1' with the name 'model.ckpt'.
58-
)
61+
)

webui.cmd

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
@echo off
22

3+
:: Run all commands using this script's directory as the working directory
4+
cd %~dp0
5+
36
:: copy over the first line from environment.yaml, e.g. name: ldm, and take the second word after splitting by ":" delimiter
47
set /p first_line=< environment.yaml
58
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 (
2629
)
2730
)
2831

29-
for %%a in (%paths%) do (
32+
for %%a in (%paths%) do (
3033
if EXIST "%%a\Scripts\activate.bat" (
3134
SET CONDA_PATH=%%a
3235
echo anaconda3/miniconda3 detected in %%a
@@ -55,4 +58,4 @@ IF EXIST "models\ldm\stable-diffusion-v1\model.ckpt" (
5558
python scripts/relauncher.py
5659
) ELSE (
5760
ECHO Your model file does not exist! Place it in 'models\ldm\stable-diffusion-v1' with the name 'model.ckpt'.
58-
)
61+
)

0 commit comments

Comments
 (0)