feat(py/plugins/google-genai): Add Virtual Try-On 001 on VertexAI#5181
Draft
cabljac wants to merge 3 commits into
Draft
feat(py/plugins/google-genai): Add Virtual Try-On 001 on VertexAI#5181cabljac wants to merge 3 commits into
cabljac wants to merge 3 commits into
Conversation
Adds virtual-try-on-001 image editing to the VertexAI plugin. - New models/virtual_try_on.py module with VirtualTryOnConfig, VirtualTryOnModel, and helper functions mirroring the JS ImagenTryOnConfigSchema and the Go PR #5177 design. - Caller identifies person vs product images via a "type" key in ai.Part metadata (PART_METADATA_TYPE_PERSON_IMAGE and PART_METADATA_TYPE_PRODUCT_IMAGE), matching the cross-runtime convention used by Go. - The google-genai Python SDK does not expose a VTO method, so the model driver issues the :predict call directly through the SDK's authenticated _api_client.async_request, so credentials, quota headers, and tracing come from the plugin's existing client config. - Empty predictions surface as a FinishReason.BLOCKED ModelResponse (matching the Go post-review behaviour), not an exception. - VertexAI plugin registers the hardcoded known-model list so VTO appears in Init and list_actions even when client.models.list() does not surface it. - Adds unit tests for the helpers and generate() flow.
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for Virtual Try-On models in the Google GenAI plugin, including the VirtualTryOnModel driver, configuration schemas, and logic for processing person and product image media parts. Unit tests were also added to ensure correct request formatting and response parsing. Feedback was provided regarding the need for consistent error handling when calling the underlying API client to ensure exceptions are properly mapped to Genkit errors.
… options and additional fields
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.
Adds
virtual-try-on-001image editing to the VertexAI backend.Callers tag input images with
metadata={'type': 'personImage' | 'productImage'}on theai.Part— same convention as the Go PR #5177. The google-genai Python SDK does not expose a VTO method, so the model driver issues the:predictcall directly through the SDK's authenticated_api_client.async_request, reusing the plugin's existing credentials / quota headers / tracing. Empty predictions surface as aFinishReason.BLOCKEDresponse, not an exception.Testing