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 <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-04-24 18:23:32 +01:00
parent 866ff126d7
commit dbe5ef3f11

View file

@ -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)");
}