43 lines
1.4 KiB
Python
43 lines
1.4 KiB
Python
"""ComfyUI V3 entry point for ``comfyui-timeline-animation``.
|
|
|
|
The wrapper subpackage is named ``timelineanim_nodes`` (not the more
|
|
common ``custom_node``) to avoid a sys.modules collision with any
|
|
other ComfyUI custom-nodes pack that uses the same generic name.
|
|
Whichever pack loaded second would otherwise silently inherit the
|
|
first one's extension via Python's import cache.
|
|
"""
|
|
|
|
import logging
|
|
import os
|
|
import sys
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
# Use os.path.dirname (not Path.resolve) so symlinked custom_nodes/
|
|
# layouts don't get eagerly dereferenced.
|
|
_SRC = os.path.join(os.path.dirname(__file__), "src")
|
|
if _SRC not in sys.path:
|
|
sys.path.insert(0, _SRC)
|
|
|
|
# Pytest collection in a non-ComfyUI env can hit this path without
|
|
# ``comfy_api`` available. Fall back to a sentinel so test collection
|
|
# doesn't fail at import time.
|
|
try:
|
|
from timelineanim_nodes import comfy_entrypoint
|
|
except ImportError as exc:
|
|
logger.warning(
|
|
"comfyui-timeline-animation: could not import comfy_entrypoint "
|
|
"(%s). Node will not register until ComfyUI's import chain is "
|
|
"available — expected in pytest runs without comfy on sys.path.",
|
|
exc,
|
|
)
|
|
comfy_entrypoint = None # type: ignore[assignment]
|
|
|
|
# ComfyUI resolves WEB_DIRECTORY relative to the __init__.py defining it.
|
|
WEB_DIRECTORY = "./src/timelineanim_nodes/web"
|
|
|
|
__all__ = [
|
|
"comfy_entrypoint",
|
|
"WEB_DIRECTORY",
|
|
]
|