Files
snomiaoandClaude Opus 4.6 dc2c298ce7 Initial commit: ComfyUI custom node for InfiniDepth depth estimation
Two nodes: InfiniDepthModelLoader and InfiniDepthEstimate.
Supports CUDA, MPS, and CPU via ComfyUI device management.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 18:59:16 +09:00

31 lines
1.2 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""ComfyUI custom node for InfiniDepth – arbitrary-resolution monocular depth estimation."""
import os
import sys
# Add the InfiniDepth repo root to sys.path so its modules can be imported.
# Supports three installation methods:
# 1. INFINIDEPTH_ROOT env var (explicit)
# 2. Symlink from ComfyUI/custom_nodes/ComfyUI-InfiniDepth -> <repo>/ComfyUI-InfiniDepth
# (realpath resolves to <repo>/ComfyUI-InfiniDepth, parent is repo root)
# 3. Cloned inside ComfyUI/custom_nodes/ with repo root elsewhere
_THIS_DIR = os.path.dirname(os.path.realpath(__file__))
_CANDIDATE_ROOT = os.path.dirname(_THIS_DIR) # parent of ComfyUI-InfiniDepth/
if os.environ.get("INFINIDEPTH_ROOT"):
_INFINIDEPTH_ROOT = os.environ["INFINIDEPTH_ROOT"]
elif os.path.isdir(os.path.join(_CANDIDATE_ROOT, "InfiniDepth")):
# Symlinked or lives next to InfiniDepth/ package
_INFINIDEPTH_ROOT = _CANDIDATE_ROOT
else:
# Fallback: traverse from ComfyUI custom_nodes path
_INFINIDEPTH_ROOT = _CANDIDATE_ROOT
if _INFINIDEPTH_ROOT not in sys.path:
sys.path.insert(0, _INFINIDEPTH_ROOT)
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]