InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

add logic for finding the root (runtime) directory

Open lstein opened this issue 2 years ago • 1 comments

This commit fixes the root search logic to be as follows:

  1. The --root_dir command line argument
  2. The contents of environment variable INVOKEAI_ROOT
  3. The VIRTUAL_ENV environment variable, plus '..'
  4. $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 avatar Dec 12 '22 14:12 lstein

@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 🙈

mauwii avatar Dec 12 '22 14:12 mauwii

@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 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 avatar Dec 12 '22 18:12 lstein

@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 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.

Ahhhh 💡 - makes total sense now!!! thx for clarification 🙏🏻

mauwii avatar Dec 12 '22 18:12 mauwii