diff --git a/invokeai/configs/INITIAL_MODELS.yaml b/invokeai/configs/INITIAL_MODELS.yaml index e250b5efba..d806b001ab 100644 --- a/invokeai/configs/INITIAL_MODELS.yaml +++ b/invokeai/configs/INITIAL_MODELS.yaml @@ -103,3 +103,28 @@ sd-1/lora/LowRA: recommended: True sd-1/lora/Ink scenery: path: https://civitai.com/api/download/models/83390 +# any/clip_vision/ip_adapter_sd_image_encoder: +# repo_id: InvokeAI/ip_adapter_sd_image_encoder +# recommended: True +# description: Required model for using IP-Adapters with SD-1/2 models +# any/clip_vision/ip_adapter_sdxl_image_encoder: +# repo_id: InvokeAI/ip_adapter_sdxl_image_encoder +# recommended: True +# description: Required model for using IP-Adapters with SDXL models +sd-1/ip_adapter/ip_adapter_sd15: + repo_id: InvokeAI/ip_adapter_sd15 + recommended: True + description: IP-Adapter for SD 1.5 models +sd-1/ip_adapter/ip_adapter_plus_sd15: + repo_id: InvokeAI/ip_adapter_plus_sd15 + recommended: False + description: Refined IP-Adapter for SD 1.5 models +sd-1/ip_adapter/ip_adapter_plus_face_sd15: + repo_id: InvokeAI/ip_adapter_plus_face_sd15 + recommended: False + description: Refined IP-Adapter for SD 1.5 models, adapted for faces +sdxl/ip_adapter/ip_adapter_sdxl: + repo_id: InvokeAI/ip_adapter_sdxl + recommended: False + description: IP-Adapter for SDXL models + diff --git a/invokeai/frontend/install/model_install.py b/invokeai/frontend/install/model_install.py index 64ad3a7d77..a76706311a 100644 --- a/invokeai/frontend/install/model_install.py +++ b/invokeai/frontend/install/model_install.py @@ -101,11 +101,12 @@ class addModelsForm(CyclingForm, npyscreen.FormMultiPage): "STARTER MODELS", "MAIN MODELS", "CONTROLNETS", + "IP-ADAPTERS", "LORA/LYCORIS", "TEXTUAL INVERSION", ], value=[self.current_tab], - columns=5, + columns=6, max_height=2, relx=8, scroll_exit=True, @@ -130,6 +131,13 @@ class addModelsForm(CyclingForm, npyscreen.FormMultiPage): ) bottom_of_table = max(bottom_of_table, self.nextrely) + self.nextrely = top_of_table + self.ipadapter_models = self.add_model_widgets( + model_type=ModelType.IPAdapter, + window_width=window_width, + ) + bottom_of_table = max(bottom_of_table, self.nextrely) + self.nextrely = top_of_table self.lora_models = self.add_model_widgets( model_type=ModelType.Lora, @@ -343,6 +351,7 @@ class addModelsForm(CyclingForm, npyscreen.FormMultiPage): self.starter_pipelines, self.pipeline_models, self.controlnet_models, + self.ipadapter_models, self.lora_models, self.ti_models, ] @@ -532,6 +541,7 @@ class addModelsForm(CyclingForm, npyscreen.FormMultiPage): self.starter_pipelines, self.pipeline_models, self.controlnet_models, + self.ipadapter_models, self.lora_models, self.ti_models, ] @@ -553,6 +563,24 @@ class addModelsForm(CyclingForm, npyscreen.FormMultiPage): if downloads := section.get("download_ids"): selections.install_models.extend(downloads.value.split()) + # special case for the ipadapter_models. If any of the adapters are + # chosen, then we add the corresponding encoder(s) to the install list. + section = self.ipadapter_models + if section.get("models_selected"): + selected_adapters = [ + self.all_models[section["models"][x]].name for x in section.get("models_selected").value + ] + encoders = [] + if any(["sdxl" in x for x in selected_adapters]): + encoders.append("ip_adapter_sdxl_image_encoder") + if any(["sd15" in x for x in selected_adapters]): + encoders.append("ip_adapter_sd_image_encoder") + for encoder in encoders: + key = f"any/clip_vision/{encoder}" + repo_id = f"InvokeAI/{encoder}" + if key not in self.all_models: + selections.install_models.append(repo_id) + class AddModelApplication(npyscreen.NPSAppManaged): def __init__(self, opt):