Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For those who confused by the "Model Not Found" error. #490

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions IPAdapterPlus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}\n\nTry to download it from <a href='https://github.com/cubiq/ComfyUI_IPAdapter_plus#installation' target='_blank' style='color:white'>HERE</a>")

if clipvision_file != self.clipvision['file']:
if clipvision_file != pipeline['clipvision']['file']:
Expand All @@ -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}\n\nTry to download it from <a href='https://github.com/cubiq/ComfyUI_IPAdapter_plus#installation' target='_blank' style='color:white'>HERE</a>")

if ipadapter_file != self.ipadapter['file']:
if pipeline['ipadapter']['file'] != ipadapter_file:
Expand Down
4 changes: 2 additions & 2 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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")
Expand Down