You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Generate images through generateContent, not Imagen (#10)
generateImage() has been broken for a while. It builds an Imagen-shaped request
(instances/parameters posted to :predict) and its default model,
imagen-4.0-fast-generate-001, has already dropped off Google's published list.
The whole Imagen line shuts down on 17 August 2026 and the :predict endpoint
goes with it.
The Gemini image models that replace it are reached through generateContent,
asking for an image modality back. That is the same shape editImage() has
always sent and parseImageResponse() has always parsed, so both methods now
share one private seam where the image wire format lives.
Two behaviour changes worth knowing about:
- Neither method invents an aspect ratio or an image size any more. editImage()
used to force 1:1 and 2K on every call, which reshaped whatever the caller
passed in. Omitting them lets the model keep the source proportions. This is
the same mistake the Agent's unconditional temperature of 0.7 was.
- numberOfImages above 1 now throws. The Gemini image models have no equivalent
of Imagen's sampleCount, so the alternative was handing back one image and
pretending four had been asked for.
The IMAGEN_* constants stay, all deprecated. Nothing defaults to them now, so
model-watch no longer reports a deprecated default.
The README documented IMAGEN_3 and IMAGEN_3_FAST, neither of which exists as a
constant; copying that example was a fatal error. Both docs now list the models
the class actually ships.