Skip to content

Conversation

@poemsforaphrodite
Copy link

Summary

This PR adds support for the resize_mode parameter to GenerateVideosConfig for Veo 3 image-to-video generation, resolving issue #1895.

Problem

The Google Vertex AI REST API supports a resizeMode parameter for image-to-video generation ("pad" or "crop"), but this functionality was missing from the Python SDK's GenerateVideosConfig class. Users attempting to use this parameter received Pydantic validation errors.

Fixes #1895

Solution

Added resize_mode parameter as an optional string field following the existing pattern used by similar parameters (aspect_ratio, resolution, person_generation):

  • Added field to GenerateVideosConfig class
  • Added field to GenerateVideosConfigDict TypedDict for dict-based initialization
  • Supports two values: "pad" (API default) and "crop"
  • Auto-converts to resizeMode via existing camelCase conversion

Changes

Type Definitions (google/genai/types.py)

  • Added resize_mode: Optional[str] field to GenerateVideosConfig class (line 9903)
  • Added corresponding field to GenerateVideosConfigDict TypedDict (line 9977)

Tests (google/genai/tests/models/test_generate_videos.py)

  • Added parametrized test cases for both "pad" and "crop" modes
  • Added integration test test_image_to_video_resize_mode_poll for full operation lifecycle
  • Updated test_all_parameters_vertex to include resize_mode with other parameters

… add tests for 'pad' and 'crop' modes in image-to-video generation.
@poemsforaphrodite poemsforaphrodite deleted the resize_mode branch January 2, 2026 17:20
@janasangeetha janasangeetha self-assigned this Jan 7, 2026
@janasangeetha janasangeetha added the size:L Code changes between 40-100 lines label Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L Code changes between 40-100 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add resize_mode parameter to GenerateVideosConfig

2 participants