"""Backend registry.""" from __future__ import annotations def comfy_bridge_available(cfg) -> bool: from . import comfy return comfy.comfy_bridge_available(cfg) def available(cfg) -> dict: """Probe both backends for /api/config.""" info = {"mock": {"available": True}, "comfy": {"available": False}} try: ok = comfy_bridge_available(cfg) info["comfy"] = {"available": ok, "url": cfg.comfyui_url} except Exception as exc: # noqa: BLE001 info["comfy"] = {"available": False, "error": str(exc)} return info