diff --git a/scripts/Start Stable Diffusion UI.cmd b/scripts/Start Stable Diffusion UI.cmd index 5453a606..428da218 100644 --- a/scripts/Start Stable Diffusion UI.cmd +++ b/scripts/Start Stable Diffusion UI.cmd @@ -11,9 +11,6 @@ call scripts\bootstrap.bat @rem set new installer's PATH, if it downloaded any packages if exist "installer_files\env" set PATH=%cd%\installer_files\env;%cd%\installer_files\env\Library\bin;%cd%\installer_files\env\Scripts;%cd%\installer_files\Library\usr\bin;%PATH% -@rem activate the installer env -call conda activate - @rem Test the bootstrap call where git call git --version diff --git a/scripts/on_sd_start.bat b/scripts/on_sd_start.bat index 0418895d..75395f0a 100644 --- a/scripts/on_sd_start.bat +++ b/scripts/on_sd_start.bat @@ -3,6 +3,13 @@ @copy sd-ui-files\scripts\on_env_start.bat scripts\ /Y @copy sd-ui-files\scripts\bootstrap.bat scripts\ /Y +if exist "%cd%\profile" ( + set USERPROFILE=%cd%\profile +) + +@rem activate the installer env +call conda activate + @REM Caution, this file will make your eyes and brain bleed. It's such an unholy mess. @REM Note to self: Please rewrite this in Python. For the sake of your own sanity. @@ -11,10 +18,6 @@ if exist "Open Developer Console.cmd" del "Open Developer Console.cmd" @call python -c "import os; import shutil; frm = 'sd-ui-files\\ui\\hotfix\\9c24e6cd9f499d02c4f21a033736dabd365962dc80fe3aeb57a8f85ea45a20a3.26fead7ea4f0f843f6eb4055dfd25693f1a71f3c6871b184042d4b126244e142'; dst = os.path.join(os.path.expanduser('~'), '.cache', 'huggingface', 'transformers', '9c24e6cd9f499d02c4f21a033736dabd365962dc80fe3aeb57a8f85ea45a20a3.26fead7ea4f0f843f6eb4055dfd25693f1a71f3c6871b184042d4b126244e142'); shutil.copyfile(frm, dst) if os.path.exists(dst) else print(''); print('Hotfixed broken JSON file from OpenAI');" -if exist "%cd%\profile" ( - set USERPROFILE=%cd%\profile -) - @>nul findstr /m "sd_git_cloned" scripts\install_status.txt @if "%ERRORLEVEL%" EQU "0" ( @echo "Stable Diffusion's git repository was already installed. Updating.." diff --git a/scripts/on_sd_start.sh b/scripts/on_sd_start.sh index 84cd7887..83035e1b 100755 --- a/scripts/on_sd_start.sh +++ b/scripts/on_sd_start.sh @@ -3,6 +3,12 @@ cp sd-ui-files/scripts/on_env_start.sh scripts/ cp sd-ui-files/scripts/bootstrap.sh scripts/ +# activate the installer env +CONDA_BASEPATH=$(conda info --base) +source "$CONDA_BASEPATH/etc/profile.d/conda.sh" # avoids the 'shell not initialized' error + +conda activate + # remove the old version of the dev console script, if it's still present if [ -e "open_dev_console.sh" ]; then rm "open_dev_console.sh" diff --git a/scripts/start.sh b/scripts/start.sh index 9bc23c07..e5981434 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -9,12 +9,6 @@ scripts/bootstrap.sh # set new installer's PATH, if it downloaded any packages if [ -e "installer_files/env" ]; then export PATH="$(pwd)/installer_files/env/bin:$PATH"; fi -# activate the installer env -CONDA_BASEPATH=$(conda info --base) -source "$CONDA_BASEPATH/etc/profile.d/conda.sh" # avoids the 'shell not initialized' error - -conda activate - # Test the bootstrap which git git --version