odysseus-dev/odysseus · error · HTTPException
No image generation endpoint configured. Add one in Settings
Error message
No image generation endpoint configured. Add one in Settings → Add Models.
What it means
HTTP 400 raised by POST /api/gallery/ai-upscale when _first_visible_image_endpoint(db, user) returns no configured image-generation endpoint. The server needs a diffusion backend (base_url ending in /v1) to proxy the upscale to {base_url}/images/upscale; with none configured for this user it refuses before any network call.
Source
Thrown at routes/gallery/gallery_routes.py:582
user = require_privilege(request, "can_generate_images")
form = await request.form()
file = form.get("image")
if not file: raise HTTPException(400, "No image")
scale = int(form.get("scale", "2"))
image_bytes = await read_upload_limited(file, GALLERY_TRANSFORM_UPLOAD_MAX_BYTES, "Image upload")
b64 = base64.b64encode(image_bytes).decode()
# Find image endpoint
db = SessionLocal()
try:
ep = _first_visible_image_endpoint(db, user)
finally:
db.close()
if not ep:
raise HTTPException(400, "No image generation endpoint configured. Add one in Settings → Add Models.")
base_url = ep.base_url.rstrip("/")
if not base_url.endswith("/v1"):
base_url += "/v1"
# Use img2img endpoint if available, otherwise upscale via canvas on client
try:
async with httpx.AsyncClient(timeout=120) as client:
resp = await client.post(f"{base_url}/images/upscale", json={
"image": b64, "scale": scale,
})
if resp.status_code == 200:
data = resp.json()
return {"image": data.get("data", [{}])[0].get("b64_json", "")}
# Fallback: no upscale endpoint — return error
return {"error": f"Upscale endpoint not available ({resp.status_code})"}
except Exception:
logger.exception("ai_upscale: request failed")View on GitHub (pinned to f9235ebbf1)
Solutions
- Add an image-generation endpoint in Settings → Add Models with its base_url.
- Verify the endpoint is visible to the requesting user, not just the admin.
- Confirm the endpoint type is image generation so the visibility filter matches.
- Check the base_url reaches the diffusion server's /v1 API.
Defensive patterns
Strategy: validation
Validate before calling
const configured = await getVisibleImageEndpoints();
if (configured.length === 0) showSetupGuide('Add an image model in Settings → Add Models'); Type guard
const hasImageEndpoint = (eps) => Array.isArray(eps) && eps.some(e => e.type === 'image');
Try / catch
try { await upscale(fd); } catch (e) { if (e.status === 400 && /endpoint configured/.test(e.message)) openSettings(); } Prevention
- Complete model setup during onboarding
- Verify endpoint visibility per user
- Health-check configured endpoints before showing AI actions
When it happens
Trigger: Fresh install with no model endpoints added; endpoints exist but are hidden from this user via visibility rules; endpoints filtered out because their type is not image generation.
Common situations: New deployments skipping the Settings setup step; per-user endpoint visibility; after deleting a misconfigured endpoint and forgetting to re-add one.
Related errors
- No image generation endpoint configured.
- No image
- Server returned ${res.status}
- HTTP ${resp.status}${detail ? `: ${detail}` : ''}
- HTTP ${saveRes.status}: ${errBody.substring(0, 120)}
AI-assisted analysis of odysseus-dev/odysseus@f9235ebbf1 (2026-08-14).
Data as JSON: /api/errors/b1b96fd4938b6396.
Report an issue: GitHub.