Posted by
Imagen 3, our most superior picture era mannequin, is now accessible by means of Vertex AI in Firebase, making it even simpler to combine it to your Android apps.
Designed to generate well-composed photos with distinctive particulars, lowered artifacts, and wealthy lighting, Imagen 3 represents a big leap ahead in picture era capabilities.


Imagen 3 unlocks thrilling new potentialities for Android builders. Generated visuals can adapt to the content material of your app, making a extra participating consumer expertise. For example, your customers can generate customized art work to boost their in-app profile. Imagen also can enhance your app’s storytelling by bringing its narratives to life with pleasant customized illustrations.
You may experiment with picture prompts in Vertex AI Studio, and discover ways to enhance your prompts by reviewing the prompt and image attribute guide.
Get began with Imagen 3
The mixing of Imagen 3 is much like including Gemini access via Vertex AI in Firebase. Begin by including the gradle dependencies to your Android challenge:
dependencies { implementation(platform("com.google.firebase:firebase-bom:33.10.0")) implementation("com.google.firebase:firebase-vertexai") }
Then, in your Kotlin code, create an ImageModel occasion by passing the mannequin identify and optionally, a model configuration and safety settings:
val imageModel = Firebase.vertexAI.imagenModel( modelName = "imagen-3.0-generate-001", generationConfig = ImagenGenerationConfig( imageFormat = ImagenImageFormat.jpeg(compresssionQuality = 75), addWatermark = true, numberOfImages = 1, aspectRatio = ImagenAspectRatio.SQUARE_1x1 ), safetySettings = ImagenSafetySettings( safetyFilterLevel = ImagenSafetyFilterLevel.BLOCK_LOW_AND_ABOVE personFilterLevel = ImagenPersonFilterLevel.ALLOW_ADULT ) )
Lastly generate the picture by calling generateImages:
val imageResponse = imageModel.generateImages( immediate = "An astronaut using a horse" )
Retrieve the generated picture from the imageResponse and show it as a bitmap as observe:
val picture = imageResponse.photos.first() val uiImage = picture.asBitmap()
Subsequent steps
Discover the great Firebase documentation for detailed API info.
Entry to Imagen 3 utilizing Vertex AI in Firebase is presently in Public Preview, supplying you with an early alternative to experiment and innovate. For pricing particulars, please seek advice from the Vertex AI in Firebase pricing page.
Begin experimenting with Imagen 3 right now! We’re trying ahead to seeing the way you’ll leverage Imagen 3’s capabilities to create actually distinctive, immersive and customized Android experiences.