Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Imagen model 002 update #1680

Merged
merged 4 commits into from
Jan 31, 2025

Conversation

katiemn
Copy link
Contributor

@katiemn katiemn commented Jan 31, 2025

Description

Update notebooks to latest Imagen model, add example for prompt enhancement feature and mask-free editing, and update samples to use new genai sdk.

@katiemn katiemn requested a review from a team as a code owner January 31, 2025 20:28
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor

@code-review-assist code-review-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.

Hi @katiemn, reviewers, and future viewers,

I'm Gemini, currently reviewing this pull request. In the meantime, I'm providing a summary for everyone to quickly grasp the changes and intent.

This pull request, titled "feat: Imagen model 002 update", aims to update the Imagen model used in several Jupyter notebooks and integrate the new Google Gen AI SDK. The description mentions adding examples for prompt enhancement and mask-free editing.

Here's a breakdown of the changes:

  • vision/getting-started/imagen3_editing.ipynb: This notebook received the most significant updates. The changes include:

    • Updating references to the Vertex AI SDK to the Google Gen AI SDK (lines 135-136, 146-147).
    • Removing the runtime restart steps (lines 149-186).
    • Adding mask-free editing to the tutorial description (lines 117-118).
    • Updating the model versions used for image generation and editing (lines 351-354, 364-367).
    • Refactoring code to use the new Google Gen AI SDK API calls for image generation and editing (lines 396-405, 419-429, 460-469, 534-549, 585-596, 654-664, 739-748, 769-779).
    • Updating the person_generation and safety_filter_level parameters to use the new enum values (lines 381-382).
    • Modifying image display functions to directly use PIL images (lines 335-337).
    • Changing how the initial image is loaded for background swap (lines 625-626).
    • Adding a new section for mask-free editing (lines 671-714).
    • Minor text corrections and clarifications throughout the notebook.
  • vision/getting-started/imagen3_image_generation.ipynb: This notebook was also updated to use the new Google Gen AI SDK and the imagen-3.0-generate-002 model (lines 289-292, 331-362, 437-448, 475-486, 512-523).

    • Added a section demonstrating prompt enhancement (lines 370-404).
    • Updated person_generation and safety_filter_level parameters to use the new enum values (lines 418-419).
  • vision/use-cases/creating_high_quality_visual_assets_with_gemini_and_imagen_vertex_ai_sdk.ipynb: This notebook was updated to use the new Google Gen AI SDK (lines 158-160).

  • vision/getting-started/imagen3_editing_vertex_ai_sdk.ipynb: A new notebook was added, seemingly a previous version of vision/getting-started/imagen3_editing.ipynb.

I'll be providing a more detailed review shortly. In the meantime, please review the summary above.

Short poem:

Code flows like a river,
Clean commits, a gentle stream,
PRs merge to the sea.

Copy link
Contributor

@code-review-assist code-review-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.

This pull request updates the notebooks to use the latest Imagen model (imagen-3.0-generate-002) and the GenAI SDK. It also adds examples for prompt enhancement and mask-free editing. The changes are well-structured and address the stated objectives. Here's a summary of my feedback, referencing elements from the provided style guide (if applicable):

  • Correctness: The code changes correctly update the model names and API calls to reflect the new Imagen model and GenAI SDK. The added examples for prompt enhancement and mask-free editing are functional and demonstrate the intended features.
  • Efficiency: The code is efficient and does not introduce any obvious performance bottlenecks. The use of the GenAI SDK simplifies the code and improves readability.
  • Maintainability: The code is well-organized and easy to understand. The use of descriptive variable names and comments enhances readability. The update to the GenAI SDK aligns with current best practices for interacting with Google Cloud AI services.
  • Security: No security vulnerabilities were identified in the code changes.
  • Miscellaneous: The updated notebooks provide clear examples and explanations of how to use the new features. The documentation is comprehensive and up-to-date.

@gericdong gericdong merged commit dc0c8bc into GoogleCloudPlatform:main Jan 31, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants