From f7522752b2f4eaf52fd2d4605bdd8bfe6bca642d Mon Sep 17 00:00:00 2001 From: Sida Liu Date: Sat, 20 Apr 2024 12:33:55 +0800 Subject: [PATCH 1/2] report search pattern in error message --- IPAdapterPlus.py | 8 ++++---- utils.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/IPAdapterPlus.py b/IPAdapterPlus.py index 89602fe..5200aa6 100644 --- a/IPAdapterPlus.py +++ b/IPAdapterPlus.py @@ -433,9 +433,9 @@ def load_models(self, model, preset, lora_strength=0.0, provider="CPU", ipadapte pipeline = ipadapter # 1. Load the clipvision model - clipvision_file = get_clipvision_file(preset) + clipvision_file, search_pattern = get_clipvision_file(preset) if clipvision_file is None: - raise Exception("ClipVision model not found.") + raise Exception(f"ClipVision model not found.\n\nSearching for {search_pattern}") if clipvision_file != self.clipvision['file']: if clipvision_file != pipeline['clipvision']['file']: @@ -447,9 +447,9 @@ def load_models(self, model, preset, lora_strength=0.0, provider="CPU", ipadapte # 2. Load the ipadapter model is_sdxl = isinstance(model.model, (comfy.model_base.SDXL, comfy.model_base.SDXLRefiner, comfy.model_base.SDXL_instructpix2pix)) - ipadapter_file, is_insightface, lora_pattern = get_ipadapter_file(preset, is_sdxl) + ipadapter_file, is_insightface, lora_pattern, search_pattern = get_ipadapter_file(preset, is_sdxl) if ipadapter_file is None: - raise Exception("IPAdapter model not found.") + raise Exception(f"IPAdapter model not found.\n\nSearching for {search_pattern}") if ipadapter_file != self.ipadapter['file']: if pipeline['ipadapter']['file'] != ipadapter_file: diff --git a/utils.py b/utils.py index 5d1811a..0cd879b 100644 --- a/utils.py +++ b/utils.py @@ -22,7 +22,7 @@ def get_clipvision_file(preset): clipvision_file = folder_paths.get_full_path("clip_vision", clipvision_file[0]) if clipvision_file else None - return clipvision_file + return clipvision_file, pattern def get_ipadapter_file(preset, is_sdxl): preset = preset.lower() @@ -110,7 +110,7 @@ def get_ipadapter_file(preset, is_sdxl): ipadapter_file = [e for e in ipadapter_list if re.search(pattern, e, re.IGNORECASE)] ipadapter_file = folder_paths.get_full_path("ipadapter", ipadapter_file[0]) if ipadapter_file else None - return ipadapter_file, is_insightface, lora_pattern + return ipadapter_file, is_insightface, lora_pattern, pattern def get_lora_file(pattern): lora_list = folder_paths.get_filename_list("loras") From 0edc2cf77db973e6888b2994c7dbcaebd0ffe552 Mon Sep 17 00:00:00 2001 From: Sida Liu Date: Sat, 20 Apr 2024 12:45:04 +0800 Subject: [PATCH 2/2] add download url --- IPAdapterPlus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IPAdapterPlus.py b/IPAdapterPlus.py index 5200aa6..88dbe30 100644 --- a/IPAdapterPlus.py +++ b/IPAdapterPlus.py @@ -435,7 +435,7 @@ def load_models(self, model, preset, lora_strength=0.0, provider="CPU", ipadapte # 1. Load the clipvision model clipvision_file, search_pattern = get_clipvision_file(preset) if clipvision_file is None: - raise Exception(f"ClipVision model not found.\n\nSearching for {search_pattern}") + raise Exception(f"ClipVision model not found.\n\nSearching for {search_pattern}\n\nTry to download it from HERE") if clipvision_file != self.clipvision['file']: if clipvision_file != pipeline['clipvision']['file']: @@ -449,7 +449,7 @@ def load_models(self, model, preset, lora_strength=0.0, provider="CPU", ipadapte is_sdxl = isinstance(model.model, (comfy.model_base.SDXL, comfy.model_base.SDXLRefiner, comfy.model_base.SDXL_instructpix2pix)) ipadapter_file, is_insightface, lora_pattern, search_pattern = get_ipadapter_file(preset, is_sdxl) if ipadapter_file is None: - raise Exception(f"IPAdapter model not found.\n\nSearching for {search_pattern}") + raise Exception(f"IPAdapter model not found.\n\nSearching for {search_pattern}\n\nTry to download it from HERE") if ipadapter_file != self.ipadapter['file']: if pipeline['ipadapter']['file'] != ipadapter_file: