Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

Imagen 3 arrives in the Gemini API

Imagen 3 arrives in the Gemini API

Developers can now access Imagen 3, Google’s state-of-the-art image generation model, through the Gemini API. The model will be initially accessible to paid users, with a rollout to the free tier coming soon.

Imagen 3 excels in producing visually appealing, artifact-free images in a wide variety of styles from hyperrealistic images to impressionistic landscapes, abstract compositions to anime characters. Improved prompt following makes it easy to convert great ideas into high-quality images. Overall, Imagen 3 achieves state-of-the-art performance on the variety of benchmarks. Imagen 3 achieves this while being priced at $0.03 per image on the Gemini API, with control over aspect ratios, the number of options to generate, and more.

To help combat misinformation and misattribution, all images generated by Imagen 3 include a non-visible digital SynthID watermark, identifying them as AI-generated.


See Imagen 3 in Action

The gallery below highlights Imagen 3’s capabilities across a range of styles.

Get Started with Imagen 3 in the Gemini API

This Python code snippet demonstrates how to generate an image with Imagen 3 using the Gemini API.

from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO

client = genai.Client(api_key='GEMINI_API_KEY')

response = client.models.generate_images(
    model='imagen-3.0-generate-002',
    prompt='a portrait of a sheepadoodle wearing cape',
    config=types.GenerateImagesConfig(
        number_of_images=2,
    )
)
for generated_image in response.generated_images:
  image = Image.open(BytesIO(generated_image.image.image_bytes))
  image.show()

You can explore more prompting advice and image styles in the Gemini API developer docs, with further details available on scores, methodology, and performance improvement in Appendix D of our updated technical report.

We are excited to take the first step of expanding availability of our generative media models into the Gemini API and plan to make more available in the near future so that developers can bridge generative media and language models together.

Source link