Repository navigation
fix(platform): make image generation follow each image model's limits - #5057
Conversation
OpenRouter publishes the aspect ratios, reference-image range and output formats of every image model in its image API listing (`/api/v1/images/models`). The catalog now merges those facts into the image entries it already lists, so the image lane can ask each model for what it draws. An image generator that writes no text may also publish no context window: OpenRouter lists the Seedream 5.0 family with 0, and the catalog dropped all three. Such a model is now kept with a window of 0, as pure transcription already was.
Live against OpenRouter (2026-10-27), image generation failed in ways the platform could have avoided: - Every Recraft model refuses the 3:2 and 2:3 a landscape and a portrait asked for. A request now asks for the shape the model draws closest to the one wanted (4:3 and 3:4 on Recraft), from the facts its catalog entry carries. - Edit models need a reference image in every request, and vector models return SVG, which the platform does not store. Neither can serve the tool, so neither is offered in the picker or picked automatically. - More reference images than a model takes (Gemini 2.5 Flash Image takes three) are refused before anything is spent, with the model's limit. - OpenAI shut GPT Image 1 down on 2026-10-23 and shuts GPT Image 1 Mini down on 2026-12-01. The recommended list now names GPT Image 2.5 Flare, the successor OpenAI names, and the OpenAI catalog lists GPT Image 2.5 Flare and Sunburst and GPT Image 2 instead of GPT Image 1. - Through OpenRouter, a GPT image model on `auto` quality cost about four times its `medium` price; it is now asked for `medium`, as on OpenAI.
An image attached in chat reaches the model as pixels, which name neither the file nor its ref, so a request to edit an upload could not hand it to generate_image: the model guessed "image1.jpg" and the tool found no such image. The model-facing turn now lists each attached image with its ref, beside the documents it already listed, for any tool that takes files.
The Models page and the self-hosted provider reference now say what the image lane does since it follows each model's limits: the closest shape a model draws, no edit or vector models in the picker, the reference-image limit refused before anything is billed, GPT Image 2.5 Flare in the recommended list, and OpenAI's shutdown of GPT Image 1 and GPT Image 1 Mini. The chat guide shows starting a new image from an attached photo. The chat spec states it as CHAT-R31, held by the attachment boundary tests, and the manual layer gains GOV-F68 (Recraft's closest shape) and CHAT-F78 (an image from an attached photo).
The appendix that lists attached images rides every chat turn, also one offered no tool that takes files, so it names none: a model is never told about a tool it was not offered (CHAT-R18). A catalog's output formats are compared case-insensitively. The integration vendor stub now answers OpenRouter's image model listing, so the catalog it serves carries the image facts the live one does.
…models From an independent review of the image changes: - A failed or unreadable facts listing was cached as a good catalog for a day, sending Recraft 3:2 requests and admitting vector models again. The last facts now keep serving, and an incomplete catalog is fetched again once the failure back-off lapses. The supplements are fetched at once. - Each image fact is read on its own, a reference minimum without a maximum is kept, and the first entry of an id decides it. - An edit model stays selectable, as it was: a call without the picture it needs is refused before anything is spent, saying why. Automatic still never picks one; vector models stay out. - GPT Image 1 Mini stays in the automatic list behind GPT Image 2.5 Flare until OpenAI shuts it down, so a credential limited to it keeps working. - The provider docs no longer promise reference limits for custom endpoints, which publish none, nor a window they do not need. - One tag and one aspect-ratio pattern, shared; an image's name is quoted in the appendix; tests for the newest turn's appendix and the request's shape.
|
Release lease: Tale v0.5.93
Update 2026-10-28 02:30Z: published and verified, so the lease is released. The receipt is the next comment. |
|
Release receipt: Tale v0.5.93
|
Why
A live check of image generation against OpenRouter (~55 image models, all four lanes) found that it worked with the default model but broke in several ways the platform could avoid:
400 aspect_ratio: not supported/api/v1/images/models) and ask for the closest one it draws (Recraft: 4:3 / 3:4)openai/gpt-image-1andopenai/gpt-5-image→The model 'gpt-image-1' does not existcontext_length: 0, and the catalog dropped every model without a windowkrea/k3-edit,recraft-v4-styles*) fail every request without a picture, after the admissionmediumpriceautoquality pickedhighmediumon OpenRouter too, as on OpenAIimage1.jpgThe facts listing is fetched with the catalog's other OpenRouter listings (now in parallel); when it fails or cannot be read, the last facts keep serving and the catalog is asked again after the failure back-off instead of a day later.
Verification
agentstep (GPT Image 2.5 Flare pinned, portrait 1024×1536, booked to the automation), Recraft/Seedream through the platform path, picker contents, edit model refused without a picture and working with one. About $3.50 of OpenRouter spend.bun run test(platform server + pii): 1,491 files, 90,431 tests green; shared tests, typecheck (platform, shared), oxlint, knip, docs suite,lint:links,lint:manual,configs:validate.backend:integrationlanescheckProviderCredentials,checkTranscription,checkImageGenerationAdmission: 94/94.Not covered
api.openai.com) was not called (no OpenAI key here); GPT Image 2.5 prices are read from OpenAI's model pages.openai/gpt-image-1andopenai/gpt-5-image, which fail upstream.gpt-image-1-minifromconfigs/platform/system/models/openai/models.ymlandPREFERRED_IMAGE_MODELS.