HKUDS/nanobot · error · ImageGenerationError

AIHubMix image generation failed: {detail}

Error message

AIHubMix image generation failed: {detail}

What it means

Error "AIHubMix image generation failed: {detail}" thrown in HKUDS/nanobot.

Source

Thrown at nanobot/providers/image_generation.py:538

        model_path = _aihubmix_model_path(model)
        url = f"{self.api_base}/models/{model_path}/predictions"
        try:
            response = await self._http_post(
                url,
                headers={**headers, "Content-Type": "application/json"},
                body=body,
                client=client,
            )
        except httpx.TimeoutException as exc:
            raise ImageGenerationError("AIHubMix image generation timed out") from exc
        except httpx.RequestError as exc:
            raise ImageGenerationError(f"AIHubMix image generation request failed: {exc}") from exc

        try:
            response.raise_for_status()
        except httpx.HTTPStatusError as exc:
            detail = response.text[:500]
            raise ImageGenerationError(f"AIHubMix image generation failed: {detail}") from exc

        payload = _as_json_object(response.json()) or {}
        images = await _aihubmix_images_from_payload(payload, proxy=self.proxy)

        self._require_images(images, payload)

        return GeneratedImageResponse(images=images, content="", raw=payload)


def _http_error_detail(response: httpx.Response) -> str:
    """Extract a readable error message from an HTTP error response."""
    try:
        data = _as_json_object(response.json())
        if data is not None:
            err = _as_json_object(data.get("error"))
            if err is not None:
                message = err.get("message")
                return message if isinstance(message, str) else str(err)

View on GitHub (pinned to 42f37dc4c0)

When it happens

Trigger: Thrown at nanobot/providers/image_generation.py:538 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/nanobot@42f37dc4c0 (2026-08-26). Data as JSON: /api/errors/4f53b24618f43f21. Report an issue: GitHub.