Skip to content
Open
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
11 changes: 10 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import torchvision.transforms.v2 as T
except ImportError:
import torchvision.transforms as T
import logging

def get_clipvision_file(preset):
preset = preset.lower()
Expand Down Expand Up @@ -149,7 +150,15 @@ def insightface_loader(provider):
except ImportError as e:
raise Exception(e)

path = os.path.join(folder_paths.models_dir, "insightface")
if not folder_paths.folder_names_and_paths.get("insightface"):
path = os.path.join(folder_paths.models_dir, "insightface")
else:
folders_insightface=folder_paths.get_folder_paths("insightface")
if len(folders_insightface)>1:
logging.info(f"[IP ADAPTER PLUS] Several insightface folders exist in extra_model_paths.yaml file. Using {folders_insightface[0]}")
path=folders_insightface[0]
else:
path=folders_insightface[0]
model = FaceAnalysis(name="buffalo_l", root=path, providers=[provider + 'ExecutionProvider',])
model.prepare(ctx_id=0, det_size=(640, 640))
return model
Expand Down