InvokeAI
InvokeAI copied to clipboard
add logic for finding the root (runtime) directory
This commit fixes the root search logic to be as follows:
- The
--root_dircommand line argument - The contents of environment variable INVOKEAI_ROOT
- The VIRTUAL_ENV environment variable, plus '..'
- $HOME/invokeai
(3) is the new feature. Since we are now recommending to install InvokeAI and its dependencies into the .venv in the root directory, this should be a reliable choice.
This addresses multiple discord bug reports and Issue #1932 . The scenario it fixes is when the user runs invoke.py from outside the runtime directory, the script can't find its runtime directory and calls configure_invoke.py to rebuild it. Configure does this, but the .venv and install.sh are still inside the original runtime directory. Confusion ensues.
@lstein are you sure you want to put all the models and stuff into the .venv folder? This sounds weird, but maybe only since I never saw something placed inside of .venv which is not placed there by python itself 🙈
@lstein are you sure you want to put all the models and stuff into the
.venvfolder? This sounds weird, but maybe only since I never saw something placed inside of.venvwhich is not placed there by python itself see_no_evil
This is a misunderstanding. Nothing but modules installed by PIP go into .venv. I use the location of .venv to identify the parent directory (with ".."). It is the parent directory that the models etc are installed in.
@lstein are you sure you want to put all the models and stuff into the
.venvfolder? This sounds weird, but maybe only since I never saw something placed inside of.venvwhich is not placed there by python itself see_no_evilThis is a misunderstanding. Nothing but modules installed by PIP go into .venv. I use the location of .venv to identify the parent directory (with ".."). It is the parent directory that the models etc are installed in.
Ahhhh 💡 - makes total sense now!!! thx for clarification 🙏🏻