Skip to content

add imagen deprecaton notice#7988

Open
VinayGuthal wants to merge 4 commits intomainfrom
deprecate_imagen
Open

add imagen deprecaton notice#7988
VinayGuthal wants to merge 4 commits intomainfrom
deprecate_imagen

Conversation

@VinayGuthal
Copy link
Copy Markdown
Contributor

@VinayGuthal VinayGuthal commented Mar 27, 2026

Summary

This PR marks all classes and public methods starting with Imagen as deprecated in the ai-logic/firebase-ai module. This is in preparation for the planned shutdown of Imagen models in June 2026. Developers are encouraged to migrate to Gemini Image models.

Changes Made

1. Class-Level Deprecation

Added standard deprecation notices to the KDoc of all identified Imagen* classes and interfaces. The notice reads:

@deprecated **Deprecation Notice:** All Imagen models are deprecated and will shut down as early as June 2026. As a replacement, you can [migrate your apps to use Gemini Image models (the 'Nano Banana' models)](https://firebase.google.com/docs/ai-logic/imagen-models-migration)

Updated files:

  • ImagenModel.kt
  • ImagenEditMode.kt
  • ImagenEditingConfig.kt
  • ImagenImagePlacement.kt
  • ImagenPersonFilterLevel.kt
  • ImagenMaskMode.kt
  • ImagenReferenceImage.kt
  • ImagenMaskConfig.kt
  • ImagenGCSImage.kt
  • ImagenSubjectConfig.kt
  • ImagenGenerationResponse.kt
  • ImagenSubjectReferenceType.kt
  • ImagenControlType.kt
  • ImagenInlineImage.kt
  • ImagenAspectRatio.kt
  • ImagenImageFormat.kt
  • ImagenGenerationConfig.kt
  • ImagenSafetyFilterLevel.kt
  • ImagenStyleConfig.kt
  • ImagenSafetySettings.kt
  • ImagenControlConfig.kt
  • ImagenModelFutures.kt
  • Request.kt (Internal request classes ImagenPrompt and ImagenParameters)

2. Method-Level Deprecation

Added the notice to public methods and helper functions within those files to ensure developers are notified when using specific features:

  • ImagenInlineImage.kt (asBitmap, toImagenInlineImage)
  • ImagenImagePlacement.kt (fromCoordinate)
  • ImagenModelFutures.kt (generateImages, editImage, inpaintImage, outpaintImage, getImageModel, from)
  • ImagenImageFormat.kt (jpeg, png)
  • ImagenGenerationConfig.kt (Builder setters, build, imagenGenerationConfig)
  • ImagenReferenceImage.kt (generateMaskAndPadForOutpainting)

3. Verification

  • Code formatted successfully with ./gradlew :ai-logic:firebase-ai:spotlessApply.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

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

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

@VinayGuthal VinayGuthal requested a review from rlazo March 27, 2026 17:52
@rlazo
Copy link
Copy Markdown
Contributor

rlazo commented Mar 27, 2026

@VinayGuthal
Copy link
Copy Markdown
Contributor Author

We can use kotlin deprecated since it doesn't allow links.. This is exactly what we did for ktx deprecation

@VinayGuthal VinayGuthal enabled auto-merge (squash) March 27, 2026 19:28
@VinayGuthal VinayGuthal requested a review from rlazo March 27, 2026 19:39
val instances: List<ImagenPrompt>,
val parameters: ImagenParameters,
) : Request {
/**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you can revert the whole file


import kotlinx.serialization.Serializable

/** Represents the control configuration for Imagen */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

revert the file

)
}

/** Represents an image response from Imagen */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

rm

internal fun toPublicGCS() = ImagenGCSImage(gcsUri!!, mimeType!!)
}

/** Represents safety attributes for Imagen */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

rm


import kotlinx.serialization.Serializable

/** Represents the mask configuration for Imagen */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

revert the file

*/
package com.google.firebase.ai.type

/** Represents the mask mode for Imagen */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

revert the file


import kotlinx.serialization.Serializable

/** Represents the style configuration for Imagen */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

revert the file


import kotlinx.serialization.Serializable

/** Represents the subject configuration for Imagen */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

revert the file

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