58 lines
2.3 KiB
Python
58 lines
2.3 KiB
Python
from .llm_gguf_node import (
|
|
NODE_CLASS_MAPPINGS as GGUF_NODES,
|
|
NODE_DISPLAY_NAME_MAPPINGS as GGUF_NAMES,
|
|
)
|
|
from .llm_chat_node import (
|
|
NODE_CLASS_MAPPINGS as CHAT_NODES,
|
|
NODE_DISPLAY_NAME_MAPPINGS as CHAT_NAMES,
|
|
)
|
|
from .llm_chat_interactive import (
|
|
NODE_CLASS_MAPPINGS as INTERACTIVE_NODES,
|
|
NODE_DISPLAY_NAME_MAPPINGS as INTERACTIVE_NAMES,
|
|
)
|
|
|
|
# Register API routes (runs at import time, decorators attach to PromptServer)
|
|
from . import llm_chat_server # noqa: F401
|
|
|
|
NODE_CLASS_MAPPINGS = {**GGUF_NODES, **CHAT_NODES, **INTERACTIVE_NODES}
|
|
NODE_DISPLAY_NAME_MAPPINGS = {**GGUF_NAMES, **CHAT_NAMES, **INTERACTIVE_NAMES}
|
|
|
|
# ── Optional: Kokoro TTS (requires `pip install kokoro-onnx`) ─────────────
|
|
try:
|
|
from .kokoro_tts_node import (
|
|
NODE_CLASS_MAPPINGS as TTS_NODES,
|
|
NODE_DISPLAY_NAME_MAPPINGS as TTS_NAMES,
|
|
)
|
|
from . import kokoro_tts_server # noqa: F401
|
|
from . import rvc_server # noqa: F401 (safe even without rvc-python)
|
|
|
|
NODE_CLASS_MAPPINGS.update(TTS_NODES)
|
|
NODE_DISPLAY_NAME_MAPPINGS.update(TTS_NAMES)
|
|
print("[LLM-Tools] Kokoro TTS enabled")
|
|
except ImportError:
|
|
print("[LLM-Tools] Kokoro TTS not available (install: pip install kokoro-onnx onnxruntime)")
|
|
except Exception as e:
|
|
print(f"[LLM-Tools] Kokoro TTS failed to load: {e}")
|
|
import traceback
|
|
traceback.print_exc()
|
|
|
|
# ── Optional: VibeVoice TTS (subprocess isolation — model loads in separate process) ─
|
|
# Manual install: pip install git+https://github.com/FushionHub/VibeVoice.git --no-deps
|
|
# VibeVoice requires transformers 4.51.3 which conflicts with ComfyUI's transformers 5.x.
|
|
# We run it in a subprocess with isolated deps (vv_deps/) — see vibevoice_subprocess.py.
|
|
try:
|
|
import vibevoice # noqa: F401 (probe availability)
|
|
from . import vibevoice_tts_server # noqa: F401
|
|
print("[LLM-Tools] VibeVoice TTS enabled (subprocess isolation)")
|
|
except ImportError:
|
|
print("[LLM-Tools] VibeVoice TTS not available — run install.py or:")
|
|
print("[LLM-Tools] pip install git+https://github.com/FushionHub/VibeVoice.git --no-deps")
|
|
except Exception as e:
|
|
print(f"[LLM-Tools] VibeVoice TTS failed to load: {e}")
|
|
import traceback
|
|
traceback.print_exc()
|
|
|
|
WEB_DIRECTORY = "./web"
|
|
|
|
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]
|