Files
iGavroche-rocm-ninodes/__init__.py
T
iGavroche 20626b4fd4 v2.2.0: ROCm SamplerCustomAdvanced drop-in with benchmark
- ROCMSamplerCustomAdvanced: V3 ComfyNode drop-in for stock SamplerCustomAdvanced
  with architecture detection, ROCm backend tuning, memory defrag for high-memory
  models (LTX 128ch), enhanced per-step callback with ETA
- ROCMSamplerCustomAdvancedBenchmark: A/B comparison node for stock vs ROCm
- docs/SAMPLER_CUSTOM_ADVANCED.md: full documentation for agents and users
- Category: ROCm Ninodes/Sampling
- Bump version to 2.2.0 across all files
2026-06-13 09:52:12 -04:00

50 lines
2.0 KiB
Python

"""
ROCm Ninodes: ROCm Optimized Nodes for ComfyUI
Optimized operations for AMD GPUs with ROCm support
This is the top-level __init__.py that ComfyUI loads.
It imports from the rocm_nodes package structure.
"""
import sys
import os
__version__ = "2.2.0"
__author__ = "iGavroche"
__email__ = "nino2k@proton.me"
__description__ = "ROCm-optimized ComfyUI nodes for AMD GPU performance"
# Ensure the current directory is on sys.path for package imports
_current_dir = os.path.dirname(os.path.abspath(__file__))
if _current_dir not in sys.path:
sys.path.insert(0, _current_dir)
# Import from the new package structure
try:
from rocm_nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
print("[ROCm Ninodes] Successfully loaded from rocm_nodes package")
except ImportError as e:
# Fallback for testing or if package structure is incomplete
print(f"[ROCm Ninodes] Failed to import from rocm_nodes package: {e}")
try:
# Try importing from old monolithic structure (backward compatibility)
import importlib.util
legacy_path = os.path.join(_current_dir, "rocm_nodes.py")
if os.path.exists(legacy_path):
spec = importlib.util.spec_from_file_location("rocm_nodes_legacy", legacy_path)
legacy_module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(legacy_module)
NODE_CLASS_MAPPINGS = legacy_module.NODE_CLASS_MAPPINGS
NODE_DISPLAY_NAME_MAPPINGS = legacy_module.NODE_DISPLAY_NAME_MAPPINGS
print("[ROCm Ninodes] Loaded from legacy rocm_nodes.py")
else:
raise ImportError(f"Legacy rocm_nodes.py not found at {legacy_path}")
except (ImportError, AttributeError) as e2:
print(f"[ROCm Ninodes] Failed to import from legacy structure: {e2}")
# Last resort: empty mappings
NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}
print("[ROCm Ninodes] WARNING: No nodes available - check installation")
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS', '__version__']