From 6138f80d2b30f58fa5d3e431f6250a7578b88184 Mon Sep 17 00:00:00 2001 From: Marcello Duarte Date: Fri, 31 Jul 2026 16:40:35 +0100 Subject: [PATCH] Point the image default back at Imagen, which is what the code speaks v0.15.2 repointed generateImage to gemini-3.1-flash-image without checking the wire format. The method builds an Imagen-shaped request, instances/parameters posted to :predict, and the Gemini image models do not speak that endpoint, so the default it shipped was very likely broken. Back to imagen-4.0-fast until the Gemini image path is actually implemented. That path is needed regardless: Imagen shuts down on 17 August 2026. --- src/GoogleProvider.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/GoogleProvider.php b/src/GoogleProvider.php index e9a4b87..49a3c4c 100644 --- a/src/GoogleProvider.php +++ b/src/GoogleProvider.php @@ -297,7 +297,10 @@ public function supportsImageEditing(): bool */ public function generateImage(string $prompt, array $options = []): array { - $model = $options['model'] ?? self::MODEL_3_1_FLASH_IMAGE; + // Imagen, not one of the Gemini image models: the request below is Imagen-shaped + // (instances/parameters on :predict) and the Gemini models do not speak that endpoint. + // Imagen shuts down 17 August 2026, so this path needs replacing before then. + $model = $options['model'] ?? self::IMAGEN_4_FAST; $numberOfImages = $options['numberOfImages'] ?? 1; $aspectRatio = $options['aspectRatio'] ?? '1:1';