ComfyUI's V3 entrypoint replaces NODE_CLASS_MAPPINGS, which must not exist at all: nodes.py checks it first and reaches comfy_entrypoint only in an elif, so an empty dict registers nothing and reports no error. A module declares NODES for graph structure and SETTINGS for preferences, and the two never mix -- a saved workflow stores class_type and input names, so letting a new setting add a socket would rot existing graphs. Traits now come from two places: facts core can read off any model, and providers announced by a model's own module. Core names no model, so supporting a new one is a folder rather than an edit here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
import sys
|
|
from pathlib import Path
|
|
|
|
# Tests import `core.*`; make the repo root importable however pytest was invoked.
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
if str(ROOT) not in sys.path:
|
|
sys.path.insert(0, str(ROOT))
|
|
|
|
|
|
def _comfyui_root():
|
|
"""ComfyUI's source tree, if this machine has one.
|
|
|
|
Tests that need real model configs or comfy_api import it; the rest of the
|
|
suite must keep running without it, which is why this is a lookup and not a
|
|
hard dependency.
|
|
"""
|
|
import os
|
|
candidates = [os.environ.get("COMFYUI_ROOT"), str(Path.home() / "Documents" / "ComfyUI")]
|
|
for candidate in candidates:
|
|
if candidate and (Path(candidate) / "comfy" / "supported_models.py").is_file():
|
|
if candidate not in sys.path:
|
|
sys.path.append(candidate)
|
|
return candidate
|
|
return None
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def comfyui():
|
|
"""ComfyUI's source tree on sys.path, or skip."""
|
|
root = _comfyui_root()
|
|
if root is None:
|
|
pytest.skip("no ComfyUI source on this machine")
|
|
return root
|