odysseus-dev/odysseus · error · HTTPException

Missing image

Error message

Missing image

What it means

Error "Missing image" thrown in odysseus-dev/odysseus.

Source

Thrown at routes/gallery/gallery_routes.py:38

    GALLERY_UPLOAD_MAX_BYTES,
    GALLERY_TRANSFORM_UPLOAD_MAX_BYTES,
)
from src.constants import GENERATED_IMAGES_DIR
from src.optional_deps import patch_realesrgan_torchvision_compat

from routes.gallery.gallery_helpers import (
    GalleryPatch, _extract_exif, _image_to_dict, _owner_filter, _human_size,
)

logger = logging.getLogger(__name__)

_SAM_STATE: Dict[str, Any] = {}
_GROUNDING_STATE: Dict[str, Any] = {}


def _b64_to_pil_image(image_b64: str, *, mode: str = "RGBA"):
    if not image_b64:
        raise HTTPException(400, "Missing image")
    if "," in image_b64 and image_b64.split(",", 1)[0].startswith("data:"):
        image_b64 = image_b64.split(",", 1)[1]
    try:
        from PIL import Image

        raw = base64.b64decode(image_b64)
        return Image.open(io.BytesIO(raw)).convert(mode)
    except HTTPException:
        raise
    except Exception as exc:
        raise HTTPException(400, "Invalid image") from exc


def _pil_image_to_b64(img, *, fmt: str = "PNG") -> str:
    buf = io.BytesIO()
    img.save(buf, format=fmt)
    return base64.b64encode(buf.getvalue()).decode("ascii")

View on GitHub (pinned to f9235ebbf1)

Solutions

  1. Include an image in the request (base64 or upload id).
  2. Select an image in the editor before running the tool.

When it happens

Trigger: Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.

Common situations: See trigger scenarios.


AI-assisted analysis of odysseus-dev/odysseus@f9235ebbf1 (2026-08-14). Data as JSON: /api/errors/34b122173d8f3dfa. Report an issue: GitHub.