from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS

WEB_DIRECTORY = "./web"

__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]


def _register_routes():
    """Register API routes with the ComfyUI server."""
    try:
        import server as comfy_server

        from .server import add_routes

        add_routes(comfy_server.PromptServer.instance.app)
    except Exception as e:
        import logging

        logging.getLogger("BooruGacha").warning(
            f"[BooruGacha] Could not register API routes: {e}"
        )


_register_routes()
