diff --git a/installer/lib/installer.py b/installer/lib/installer.py index e1ca8c2e8f..f15c83ba66 100644 --- a/installer/lib/installer.py +++ b/installer/lib/installer.py @@ -168,7 +168,10 @@ class Installer: messages.welcome() - self.dest = Path(root).expanduser().resolve() if yes_to_all else messages.dest_path(root) + invokeai_root = os.environ.get('INVOKEAI_ROOT') + default_path = invokeai_root or Path(root).expanduser().resolve() + + self.dest = default_path if yes_to_all else messages.dest_path(root) # create the venv for the app self.venv = self.app_venv() diff --git a/invokeai/frontend/install/model_install.py b/invokeai/frontend/install/model_install.py index ea9efe1908..78dd0f88d0 100644 --- a/invokeai/frontend/install/model_install.py +++ b/invokeai/frontend/install/model_install.py @@ -58,6 +58,8 @@ logger = InvokeAILogger.getLogger() # from https://stackoverflow.com/questions/92438/stripping-non-printable-characters-from-a-string-in-python NOPRINT_TRANS_TABLE = {i: None for i in range(0, sys.maxunicode + 1) if not chr(i).isprintable()} +# maximum number of installed models we can display before overflowing vertically +MAX_OTHER_MODELS = 72 def make_printable(s: str) -> str: """Replace non-printable characters in a string""" @@ -271,6 +273,11 @@ class addModelsForm(CyclingForm, npyscreen.FormMultiPage): ) ) + truncation = False + if len(model_labels) > MAX_OTHER_MODELS: + model_labels = model_labels[0:MAX_OTHER_MODELS] + truncation = True + widgets.update( models_selected=self.add_widget_intelligent( MultiSelectColumns, @@ -289,6 +296,16 @@ class addModelsForm(CyclingForm, npyscreen.FormMultiPage): models=model_list, ) + if truncation: + widgets.update( + warning_message = self.add_widget_intelligent( + npyscreen.FixedText, + value=f"Too many models to display (max={MAX_OTHER_MODELS}). Some are not displayed.", + editable=False, + color="CAUTION", + ) + ) + self.nextrely += 1 widgets.update( download_ids=self.add_widget_intelligent(