Skip to content

Commit

Permalink
fixed: potential error by extra_model_paths.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
ltdrdata committed Jan 25, 2025
1 parent f5467e1 commit 979f356
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import importlib
import logging

version_code = [1, 2, 7]
version_code = [1, 2, 8]
version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
logging.info(f"### Loading: ComfyUI-Impact-Subpack ({version_str})")

Expand Down
15 changes: 15 additions & 0 deletions modules/subpack_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ def INPUT_TYPES(s):

def doit(self, model_name):
model_path = folder_paths.get_full_path("ultralytics", model_name)

if model_path is None:
print(f"[Impact Subpack] model file '{model_name}' is not found in one of the following directories:")

cands = []
cands.extend(folder_paths.get_folder_paths("ultralytics"))
if model_name.startswith('bbox/'):
cands.extend(folder_paths.get_folder_paths("ultralytics_bbox"))
elif model_name.startswith('segm/'):
cands.extend(folder_paths.get_folder_paths("ultralytics_segm"))

print(f'\t{"\n\t".join(cands)}\n')

raise ValueError(f"[Impact Subpack] model file '{model_name}' is not found.")

model = subcore.load_yolo(model_path)

if model_name.startswith("bbox"):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "comfyui-impact-subpack"
description = "This node pack provides nodes that complement the Impact Pack, such as the UltralyticsDetectorProvider."
version = "1.2.7"
version = "1.2.8"
license = { file = "LICENSE.txt" }
dependencies = ["matplotlib", "ultralytics==8.3.40"]

Expand Down

0 comments on commit 979f356

Please sign in to comment.