Repository navigation
fix(image-gen): make the Gemini image model configurable and replace the retired default - #4718
Merged
Merged
Conversation
…the retired default The image model was hard-coded to gemini-3.1-flash-image-preview, which Google shut down. Move it to config.py as GEMINI_IMAGE_MODEL (env-overridable, same pattern as GEMINI_TEXT_MODEL) and default to gemini-nano-banana-2.1. Wired into all compose files and .env.example. Signed-off-by: Alex <[email protected]>
) — mechanical, per the merge-train note on the PR - feature-flows/image-generation.md, agent-avatars.md: name the configurable image model instead of the retired Gemini 3.1 Flash Image Preview; list GEMINI_IMAGE_MODEL in Configuration - .env.example: the override comment covers the third var and its different default - test_image_generation_service.py: the comment cites Abilityai#4717 (was the nonexistent #4949) Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Eugene Vyborov <[email protected]>
Contributor
|
merge-train (2026-11-22): on this train. Validated at One mechanical commit pushed to your branch as
I approved this fork's CI runs. Note for the release: the default image model changes for installs that don't set the variable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4717
Cause. The image model was hard-coded to
gemini-3.1-flash-image-preview, which Google lists as shut down (2026-06-25) withgemini-nano-banana-2.1as its replacement (https://ai.google.dev/gemini-api/docs/deprecations). Platform image generation therefore fails by default, and there was no config escape hatch (unlikeGEMINI_TEXT_MODEL, #1130).Fix. Add
GEMINI_IMAGE_MODELtosrc/backend/config.py(os.getenv(...) or "gemini-nano-banana-2.1", same empty-string coalesce as the text model) and import it inimage_generation_service.py, so the request URL,model_usedand the/image-generationstatus response follow it. The new env var is wired intodocker-compose.yml,docker-compose.prod.yml,docker-compose.hosted.ymland.env.example, as CONTRIBUTING requires; the two feature-flow docs that quote the old id are updated.Test.
tests/unit/test_image_generation_service.py::TestCallGeminiImage::test_image_model_comes_from_config(names the issue's behavior: URL andGEMINI_IMAGE_MODELmust follow config). It fails ondevand passes with the change; the rest of the file still passes (44 passed).Disclosure: this change was prepared with the assistance of an AI coding agent (Claude) and submitted by a human contributor.