odysseus-dev/odysseus · error · HTTPException
No image generation endpoint configured.
Error message
No image generation endpoint configured.
What it means
HTTP 400 raised by POST /api/gallery/style-transfer when no visible image-generation endpoint is configured for the user. Identical cause to the ai-upscale variant (553) with a shorter message: _first_visible_image_endpoint returned None, so there is no diffusion server to send the img2img request to.
Source
Thrown at routes/gallery/gallery_routes.py:626
user = require_privilege(request, "can_generate_images")
form = await request.form()
file = form.get("image")
prompt = form.get("prompt", "")
strength = float(form.get("strength", "0.55"))
if not file: raise HTTPException(400, "No image")
image_bytes = await read_upload_limited(file, GALLERY_TRANSFORM_UPLOAD_MAX_BYTES, "Image upload")
b64 = base64.b64encode(image_bytes).decode()
db = SessionLocal()
try:
ep = _first_visible_image_endpoint(db, user)
finally:
db.close()
if not ep:
raise HTTPException(400, "No image generation endpoint configured.")
base_url = ep.base_url.rstrip("/")
if not base_url.endswith("/v1"):
base_url += "/v1"
try:
async with httpx.AsyncClient(timeout=180) as client:
resp = await client.post(f"{base_url}/images/generations", json={
"prompt": prompt,
"image": b64,
"strength": strength,
"response_format": "b64_json",
})
if resp.status_code == 200:
data = resp.json()
img_data = data.get("data", [{}])[0].get("b64_json", "")
if img_data:
return {"image": img_data}View on GitHub (pinned to f9235ebbf1)
Solutions
- Configure an image-generation endpoint in Settings with a valid base_url.
- Ensure endpoint visibility includes the requesting user.
- Surface a setup prompt in the UI when this 400 arrives instead of showing a generic failure.
Defensive patterns
Strategy: validation
Validate before calling
const eps = await getVisibleImageEndpoints();
if (!eps.length) { showSetupGuide('Configure an image generation endpoint'); return; } Type guard
const hasImageEndpoint = (eps) => Array.isArray(eps) && eps.length > 0;
Try / catch
try { await styleTransfer(fd); } catch (e) { if (e.status === 400 && /endpoint/.test(e.message)) redirectToSettings(); } Prevention
- Add an image endpoint before advertising AI features
- Check endpoint visibility for the acting user
- Validate base_url reaches the diffusion server's /v1
When it happens
Trigger: Running style transfer before any image endpoint is added, or when all configured endpoints are hidden from the requesting user.
Common situations: Post-install onboarding gap; endpoint visibility scoped per user or role; environment where the models table was cleared.
Related errors
- No image generation endpoint configured. Add one in Settings
- HTTP ${resp.status}${detail ? `: ${detail}` : ''}
- HTTP ${saveRes.status}: ${errBody.substring(0, 120)}
- HTTP ${res.status}${body ? ': ' + body.slice(0, 160) : ''}
- Selected model endpoint was removed. Pick another model in S
AI-assisted analysis of odysseus-dev/odysseus@f9235ebbf1 (2026-08-14).
Data as JSON: /api/errors/4fcd93f6add68346.
Report an issue: GitHub.