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 3 inpainting and outpainting samples #13049

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

katiemn
Copy link
Contributor

@katiemn katiemn commented Jan 10, 2025

New samples for Imagen 3 editing

@katiemn katiemn requested review from a team as code owners January 10, 2025 23:42
Copy link

snippet-bot bot commented Jan 10, 2025

Here is the summary of changes.

You are about to add 6 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Jan 10, 2025
Copy link

@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 readers!

I'm Gemini, and I'm 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 3 inpainting and outpainting samples", aims to add new samples demonstrating Imagen 3's image editing capabilities, specifically inpainting and outpainting.

Here's a breakdown of the changes:

  • New Python sample files added:
    • generative_ai/image_generation/imagen3_editing/edit_image_3_inpainting_insert_mask.py: This sample shows how to perform inpainting by inserting an object into a masked area of an image using a user-provided mask. The example inserts a "red hat" into an image of a woman. (Lines 1-80)
    • generative_ai/image_generation/imagen3_editing/edit_image_3_inpainting_insert_mask_mode.py: This sample demonstrates inpainting using automatic mask modes ("background", "foreground", or "semantic") to insert objects or backgrounds. The example adds a "beach" to the background of an image of a woman. (Lines 1-81)
    • generative_ai/image_generation/imagen3_editing/edit_image_3_inpainting_remove_mask.py: This sample shows how to remove an object from an image using a user-provided mask. The example removes a player from a volleyball game image. (Lines 1-81)
    • generative_ai/image_generation/imagen3_editing/edit_image_3_inpainting_remove_mask_mode.py: This sample demonstrates removing objects or backgrounds using automatic mask modes. The example removes the foreground (woman) from an image, leaving only the background. (Lines 1-80)
    • generative_ai/image_generation/imagen3_editing/edit_image_3_outpainting_mask.py: This sample shows how to perform outpainting, expanding the image content beyond its original boundaries using a user-provided mask. The example expands a picture of roller skaters to include a city skyline. (Lines 1-80)
  • Corresponding test files added: Each of the above sample files has a corresponding test file (e.g., ..._test.py) to ensure the functionality works as expected. These tests verify that the image editing functions produce outputs with a byte size greater than 1000 bytes. (Lines 1-42 for each test file)

All new files include standard copyright headers (Lines 1-14 in each file).

I'll have a more detailed review shortly. In the meantime, please let me know if you have any questions.

And now, a little haiku to brighten your day:

Pixels shift and change,
Images reborn, anew,
Code's magic unfolds.

Copy link

@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.

These samples demonstrate useful Imagen 3 editing features. The code is well-structured and easy to follow. The use of descriptive variable names and comments makes the code easy to understand. The test cases are also well-written and cover the main functionalities of the samples. A few minor suggestions for improvement are included below.

@katiemn katiemn marked this pull request as draft January 10, 2025 23:50
@katiemn katiemn marked this pull request as ready for review January 13, 2025 21:12
@katiemn katiemn added kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed kokoro:run Add this label to force Kokoro to re-run the tests. labels Jan 13, 2025
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants