mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-07-10 08:27:13 +08:00
Allow .onnx models in the detection folder
PR #14025 registered models/detection/ with supported_pt_extensions only, which excludes .onnx files used by WanAnimate ONNX loaders and other detection nodes. That caused prompt validation to reject values like vitpose-l-wholebody.onnx with value_not_in_list even when the UI showed them as selectable. Fixes #14050 Fixes #14635 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
985fb9d6ad
commit
38bfd71ba0
@ -58,7 +58,7 @@ folder_names_and_paths["geometry_estimation"] = ([os.path.join(models_dir, "geom
|
|||||||
|
|
||||||
folder_names_and_paths["optical_flow"] = ([os.path.join(models_dir, "optical_flow")], supported_pt_extensions)
|
folder_names_and_paths["optical_flow"] = ([os.path.join(models_dir, "optical_flow")], supported_pt_extensions)
|
||||||
|
|
||||||
folder_names_and_paths["detection"] = ([os.path.join(models_dir, "detection")], supported_pt_extensions)
|
folder_names_and_paths["detection"] = ([os.path.join(models_dir, "detection")], supported_pt_extensions | {".onnx"})
|
||||||
|
|
||||||
output_directory = os.path.join(base_path, "output")
|
output_directory = os.path.join(base_path, "output")
|
||||||
temp_directory = os.path.join(base_path, "temp")
|
temp_directory = os.path.join(base_path, "temp")
|
||||||
|
|||||||
@ -0,0 +1,23 @@
|
|||||||
|
import os
|
||||||
|
import tempfile
|
||||||
|
|
||||||
|
import folder_paths
|
||||||
|
|
||||||
|
|
||||||
|
def test_detection_folder_allows_onnx_extension():
|
||||||
|
_, extensions = folder_paths.folder_names_and_paths["detection"]
|
||||||
|
assert ".onnx" in extensions
|
||||||
|
|
||||||
|
|
||||||
|
def test_detection_folder_lists_onnx_files():
|
||||||
|
with tempfile.TemporaryDirectory() as detection_dir:
|
||||||
|
onnx_path = os.path.join(detection_dir, "vitpose-l-wholebody.onnx")
|
||||||
|
with open(onnx_path, "wb") as onnx_file:
|
||||||
|
onnx_file.write(b"onnx")
|
||||||
|
|
||||||
|
folder_paths.add_model_folder_path("detection", detection_dir, is_default=True)
|
||||||
|
folder_paths.filename_list_cache.pop("detection", None)
|
||||||
|
|
||||||
|
filenames = folder_paths.get_filename_list("detection")
|
||||||
|
assert "vitpose-l-wholebody.onnx" in filenames
|
||||||
|
assert folder_paths.get_full_path("detection", "vitpose-l-wholebody.onnx") == onnx_path
|
||||||
Loading…
Reference in New Issue
Block a user