From dbe5ef3f116ef65b657abca463514522b1dd4961 Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Fri, 24 Apr 2026 18:23:32 +0100 Subject: [PATCH] fix: revert Veo I2V image format to bytesBase64Encoded The Veo predictLongRunning endpoint is a predict-style API (not generateContent) and expects image data as: { "bytesBase64Encoded": "...", "mimeType": "image/jpeg" } The previous session switched it to inlineData (generateContent format), causing the API to reject it with: "inlineData isn't supported by this model" Co-Authored-By: Claude Sonnet 4.6 --- backend/video_api.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/video_api.php b/backend/video_api.php index 4a48c6f..dfcafc7 100644 --- a/backend/video_api.php +++ b/backend/video_api.php @@ -171,7 +171,8 @@ class VeoVideoAPI { $mimeType = $refImg['mime_type'] ?? 'image/jpeg'; $data = $this->resizeImageForVeo($data, $mimeType, $aspectRatio); $instance['image'] = [ - 'inlineData' => ['mimeType' => $mimeType, 'data' => $data] + 'bytesBase64Encoded' => $data, + 'mimeType' => $mimeType ]; error_log("Added first frame for I2V generation (resized to match $aspectRatio)"); } @@ -188,7 +189,8 @@ class VeoVideoAPI { $lastMimeType = $lastImg['mime_type'] ?? 'image/jpeg'; $lastData = $this->resizeImageForVeo($lastData, $lastMimeType, $aspectRatio); $instance['lastFrame'] = [ - 'inlineData' => ['mimeType' => $lastMimeType, 'data' => $lastData] + 'bytesBase64Encoded' => $lastData, + 'mimeType' => $lastMimeType ]; error_log("Added lastFrame to instance for video interpolation (8s duration)"); }