From c14aa30956c4255f49dce00d20c3e5a2b1df6a1e Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Mon, 23 Oct 2023 20:37:33 -0400 Subject: [PATCH] fix the merge script to correctly display models sorted by base --- invokeai/frontend/merge/merge_diffusers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/merge/merge_diffusers.py b/invokeai/frontend/merge/merge_diffusers.py index 8fa02cb49c..f3672acbf2 100644 --- a/invokeai/frontend/merge/merge_diffusers.py +++ b/invokeai/frontend/merge/merge_diffusers.py @@ -131,6 +131,7 @@ class mergeModelsForm(npyscreen.FormMultiPageAction): values=[ "Models Built on SD-1.x", "Models Built on SD-2.x", + "Models Built on SDXL", ], value=[self.current_base], columns=4, @@ -309,7 +310,7 @@ class mergeModelsForm(npyscreen.FormMultiPageAction): else: return True - def get_model_names(self, base_model: Optional[BaseModelType] = None) -> List[str]: + def get_model_names(self, base_model: BaseModelType = BaseModelType.StableDiffusion1) -> List[str]: model_names = [ info["model_name"] for info in self.model_manager.list_models(model_type=ModelType.Main, base_model=base_model) @@ -318,7 +319,8 @@ class mergeModelsForm(npyscreen.FormMultiPageAction): return sorted(model_names) def _populate_models(self, value=None): - base_model = tuple(BaseModelType)[value[0]] + bases = ["sd-1", "sd-2", "sdxl"] + base_model = BaseModelType(bases[value[0]]) self.model_names = self.get_model_names(base_model) models_plus_none = self.model_names.copy()