Skip to content

feat(py/plugins/google-genai): Add Imagen 4 models on GoogleAI#5180

Draft
cabljac wants to merge 3 commits into
mainfrom
feat/py-googleai-imagen-4
Draft

feat(py/plugins/google-genai): Add Imagen 4 models on GoogleAI#5180
cabljac wants to merge 3 commits into
mainfrom
feat/py-googleai-imagen-4

Conversation

@cabljac
Copy link
Copy Markdown
Contributor

@cabljac cabljac commented Apr 23, 2026

Adds the three Imagen 4 models on the GoogleAI (Gemini API) backend:

  • imagen-4.0-generate-001
  • imagen-4.0-fast-generate-001
  • imagen-4.0-ultra-generate-001

Mirrors JS js/plugins/google-genai/src/googleai/imagen.ts KNOWN_MODELS. Also adds a googleai_image_model_info helper so GoogleAI imagen models no longer carry a "Vertex AI" label, and unions a hardcoded known-model list into the plugin's imagen enumeration so the models are visible in Init / list_actions even when the SDK's client.models.list() doesn't surface them.

Testing

image

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for Imagen 4 models to the Google GenAI plugin and ensures their availability by hardcoding known versions to supplement SDK discovery. It also introduces provider-specific model info helpers for Vertex AI and Google AI. Review feedback identifies a risk of incorrect labeling due to shared state in the SUPPORTED_MODELS dictionary and suggests simplifying the model list union logic to improve maintainability and reduce duplication.

Comment thread py/plugins/google-genai/src/genkit/plugins/google_genai/models/imagen.py Outdated
Comment thread py/plugins/google-genai/src/genkit/plugins/google_genai/google.py Outdated
Comment thread py/plugins/google-genai/src/genkit/plugins/google_genai/google.py Outdated
@cabljac cabljac force-pushed the feat/py-googleai-imagen-4 branch from a130c96 to eda4a5e Compare April 23, 2026 11:00
Registers imagen-4.0-generate-001, imagen-4.0-fast-generate-001, and
imagen-4.0-ultra-generate-001 on the GoogleAI (Gemini API) backend.

- Adds the three versions to ImagenVersion and SUPPORTED_MODELS with
  "Google AI - Imagen 4*" labels.
- Adds a googleai_image_model_info helper so GoogleAI Imagen models no
  longer fall back to a "Vertex AI" label.
- Unions the hardcoded GOOGLEAI_KNOWN_IMAGEN_MODELS list into the
  GoogleAI plugin's imagen enumeration so Init and list_actions expose
  the models even if client.models.list() doesn't yet surface them.
- Existing parametrised Imagen test automatically covers the three new
  versions via iteration over ImagenVersion.
@cabljac cabljac force-pushed the feat/py-googleai-imagen-4 branch from eda4a5e to 79ffbfe Compare April 23, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants