Skip to content

Conversation

@jdomingr
Copy link
Contributor

Add new samples for image generation:

  • Image generation with text input
  • Image generation locale aware with text input
  • Multiple image generation with text input

All local tests have passed

@jdomingr jdomingr requested review from a team as code owners November 27, 2025 14:42
@snippet-bot
Copy link

snippet-bot bot commented Nov 27, 2025

Here is the summary of changes.

You are about to add 3 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 Nov 27, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @jdomingr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the GenAI SDK samples by adding new C# examples for image generation. These samples cover various scenarios, including basic text-to-image generation, locale-aware image generation, and the ability to generate multiple images from a single prompt, providing comprehensive demonstrations of the SDK's image generation features.

Highlights

  • New Image Generation Samples: Introduces three new C# samples demonstrating various image generation capabilities using the GenAI SDK.
  • Text-to-Image Generation: Includes a sample for generating a single image from a text prompt, showcasing basic functionality.
  • Locale-Aware Image Generation: Provides a sample for generating images with locale considerations, demonstrating how to adapt generation based on regional settings.
  • Multiple Image Generation: Adds a sample to generate multiple images from a single text input, illustrating batch image creation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@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 introduces new samples for image generation with GenAI, including tests. The code is clear and effectively demonstrates the intended features. I've provided a few suggestions to improve naming consistency, fix typos in code region tags, and enhance the robustness of filename generation in the multiple-image sample.

@gericdong gericdong added the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 27, 2025
@kokoro-team kokoro-team removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 27, 2025
Copy link

@matthew29tang matthew29tang left a comment

Choose a reason for hiding this comment

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

Code LGTM, left one minor question about a code sample name

* limitations under the License.
*/

// [START googlegenaisdk_imggen_mmflash_locale_aware_with_txt]

Choose a reason for hiding this comment

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

Just curious why this sample is called locale aware?

using System.IO;
using System.Threading.Tasks;

public class ImgGenMmFlashLocaleAwareWithTxt

Choose a reason for hiding this comment

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

I think that this should have a clearer name. Specifically, the Mm part does not reflect that.

string projectId = "your-project-id",
string location = "global",
string model = "gemini-2.5-flash-image")
{

Choose a reason for hiding this comment

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

Some of the samples have a try-catch to catch the errors. I think that we should aim for that here as well just to 1. showcase some simple error handling, and 2. keep consistency with other languages that have a try-catch as well.

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.

6 participants