odysseus-dev/odysseus · error · HTTPException

dall-e-3 doesn't support image edits — pick gpt-image-1 or d

Error message

dall-e-3 doesn't support image edits — pick gpt-image-1 or dall-e-2

What it means

Error "dall-e-3 doesn't support image edits — pick gpt-image-1 or dall-e-2" thrown in odysseus-dev/odysseus.

Source

Thrown at routes/gallery/gallery_routes.py:1367

            height = int(body.get("height") or 1024)
            # gpt-image-1 only accepts 1024x1024, 1024x1536, 1536x1024 (no 'auto'
            # for edits). Pick the closest to preserve aspect, default square.
            if width > height * 1.15:
                size = "1536x1024"
            elif height > width * 1.15:
                size = "1024x1536"
            else:
                size = "1024x1024"

            files = {
                "image": ("source.png", src_buf.getvalue(), "image/png"),
                "mask": ("mask.png", mask_buf.getvalue(), "image/png"),
            }
            # Honor explicit model selection from the editor; fall back to gpt-image-1.
            # dall-e-3 has no edit endpoint — refuse it loudly so the user picks again.
            oa_model = chosen_model or "gpt-image-1"
            if "dall-e-3" in oa_model:
                raise HTTPException(400, "dall-e-3 doesn't support image edits — pick gpt-image-1 or dall-e-2")
            data = {
                "model": oa_model,
                "prompt": body.get("prompt", ""),
                "size": size,
                "n": "1",
            }
            headers = {"Authorization": f"Bearer {api_key}"}
            try:
                async with httpx.AsyncClient(timeout=120) as client:
                    r = await client.post(_join_checked_gallery_endpoint(base, "/images/edits"), headers=headers, data=data, files=files)
                    if r.status_code != 200:
                        logger.error("inpaint_proxy OpenAI edit: status %s", r.status_code)
                        raise HTTPException(r.status_code, "OpenAI edit failed")
                    result = r.json()
                    raw_b64 = None
                    if result.get("data"):
                        item = result["data"][0]
                        # gpt-image-1 returns b64_json by default; dall-e-2 may return url

View on GitHub (pinned to f9235ebbf1)

Solutions

  1. Pick gpt-image-1 or dall-e-2 for image edits.
  2. Use dall-e-3 only for text-to-image generation.

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/ce30a89f0fcabfaf. Report an issue: GitHub.