From 9307ce3dc39da744758bba0fe4166b4190e2c034 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sun, 5 Feb 2023 11:05:33 -0500 Subject: [PATCH] this fixes a crash in the TI frontend (#2527) - This fixes an edge case crash when the textual inversion frontend tried to display the list of models and no default model defined in models.yaml Co-authored-by: Jonathan <34005131+JPPhoto@users.noreply.github.com> --- ldm/invoke/training/textual_inversion.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ldm/invoke/training/textual_inversion.py b/ldm/invoke/training/textual_inversion.py index 835ad2d04e..5402e05ec9 100755 --- a/ldm/invoke/training/textual_inversion.py +++ b/ldm/invoke/training/textual_inversion.py @@ -295,7 +295,8 @@ class textualInversionForm(npyscreen.FormMultiPageAction): for idx in range(len(model_names)) if "default" in conf[model_names[idx]] ] - return (model_names, defaults[0]) + default = defaults[0] if len(defaults)>0 else 0 + return (model_names, default) def marshall_arguments(self) -> dict: args = dict()