Skip to content

Commit 51d4de3

Browse files
committed
Merge branch 'main' into nc/fix-15974
2 parents ca1291e + 701e8a3 commit 51d4de3

34 files changed

+483
-31
lines changed

FirebaseAI/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Unreleased
2+
- [deprecated] All Imagen models are deprecated and will shut down as early as June 2026.
3+
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).
4+
15
# 12.12.0
26
- [fixed] Updated `GenerativeModelSession` to handle intermediate JSON decoding
37
failures when streaming structured data. (#15960)

FirebaseAI/Sources/FirebaseAI.swift

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,25 @@ public final class FirebaseAI: Sendable {
130130
/// - Note: Refer to [Imagen models](https://firebase.google.com/docs/vertex-ai/models) for
131131
/// guidance on choosing an appropriate model for your use case.
132132
///
133+
///
134+
/// @DeprecationSummary {
135+
/// All Imagen models are deprecated and will shut down as early as June 2026.
136+
/// As a replacement, you can [migrate your apps to use Gemini Image models
137+
/// (the "Nano Banana"
138+
/// models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
139+
/// }
140+
///
133141
/// - Parameters:
134142
/// - modelName: The name of the Imagen 3 model to use.
135143
/// - generationConfig: Configuration options for generating images with Imagen.
136144
/// - safetySettings: Settings describing what types of potentially harmful content your model
137145
/// should allow.
138146
/// - requestOptions: Configuration parameters for sending requests to the backend.
147+
@available(
148+
*,
149+
deprecated,
150+
message: "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)."
151+
)
139152
public func imagenModel(modelName: String, generationConfig: ImagenGenerationConfig? = nil,
140153
safetySettings: ImagenSafetySettings? = nil,
141154
requestOptions: RequestOptions = RequestOptions()) -> ImagenModel {
@@ -169,7 +182,19 @@ public final class FirebaseAI: Sendable {
169182

170183
/// Initializes a new `TemplateImagenModel`.
171184
///
185+
/// @DeprecationSummary {
186+
/// All Imagen models are deprecated and will shut down as early as June 2026.
187+
/// As a replacement, you can [migrate your apps to use Gemini Image models
188+
/// (the "Nano Banana"
189+
/// models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
190+
/// }
191+
///
172192
/// - Returns: A new `TemplateImagenModel` instance.
193+
@available(
194+
*,
195+
deprecated,
196+
message: "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)."
197+
)
173198
public func templateImagenModel() -> TemplateImagenModel {
174199
return TemplateImagenModel(
175200
generativeAIService: GenerativeAIService(firebaseInfo: firebaseInfo,

FirebaseAI/Sources/TemplateImagenGenerationRequest.swift

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,30 @@
1414

1515
import Foundation
1616

17+
/// @DeprecationSummary {
18+
/// All Imagen models are deprecated and will shut down as early as June 2026.
19+
/// As a replacement, you can [migrate your apps to use Gemini Image models
20+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
21+
/// }
22+
@available(
23+
*,
24+
deprecated,
25+
message: "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)."
26+
)
1727
enum ImageAPIMethod: String {
1828
case generateImages = "templatePredict"
1929
}
2030

31+
/// @DeprecationSummary {
32+
/// All Imagen models are deprecated and will shut down as early as June 2026.
33+
/// As a replacement, you can [migrate your apps to use Gemini Image models
34+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
35+
/// }
36+
@available(
37+
*,
38+
deprecated,
39+
message: "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)."
40+
)
2141
struct TemplateImagenGenerationRequest<ImageType: ImagenImageRepresentable>: Sendable {
2242
typealias Response = ImagenGenerationResponse<ImageType>
2343

@@ -37,6 +57,16 @@ struct TemplateImagenGenerationRequest<ImageType: ImagenImageRepresentable>: Sen
3757
}
3858
}
3959

60+
/// @DeprecationSummary {
61+
/// All Imagen models are deprecated and will shut down as early as June 2026.
62+
/// As a replacement, you can [migrate your apps to use Gemini Image models
63+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
64+
/// }
65+
@available(
66+
*,
67+
deprecated,
68+
message: "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)."
69+
)
4070
extension TemplateImagenGenerationRequest: GenerativeAIRequest where ImageType: Decodable {
4171
func getURL() throws -> URL {
4272
var urlString =
@@ -52,6 +82,16 @@ extension TemplateImagenGenerationRequest: GenerativeAIRequest where ImageType:
5282
}
5383
}
5484

85+
/// @DeprecationSummary {
86+
/// All Imagen models are deprecated and will shut down as early as June 2026.
87+
/// As a replacement, you can [migrate your apps to use Gemini Image models
88+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
89+
/// }
90+
@available(
91+
*,
92+
deprecated,
93+
message: "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)."
94+
)
5595
extension TemplateImagenGenerationRequest: Encodable {
5696
enum CodingKeys: String, CodingKey {
5797
case inputs

FirebaseAI/Sources/TemplateImagenModel.swift

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,20 @@
1515
import Foundation
1616

1717
/// A type that represents a remote image generation model (like Imagen), with the ability to
18-
/// generate
19-
/// images based on various input types.
18+
/// generate images based on various input types.
19+
///
20+
/// @DeprecationSummary {
21+
/// All Imagen models are deprecated and will shut down as early as June 2026.
22+
/// As a replacement, you can [migrate your apps to use Gemini Image models
23+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
24+
/// }
2025
///
2126
/// **Public Preview**: This API is a public preview and may be subject to change.
27+
@available(
28+
*,
29+
deprecated,
30+
message: "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)."
31+
)
2232
public final class TemplateImagenModel: Sendable {
2333
let generativeAIService: GenerativeAIService
2434
let apiConfig: APIConfig

FirebaseAI/Sources/Types/Internal/Imagen/ImageGenerationInstance.swift

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,42 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
/// @DeprecationSummary {
16+
/// All Imagen models are deprecated and will shut down as early as June 2026.
17+
/// As a replacement, you can [migrate your apps to use Gemini Image models
18+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
19+
/// }
20+
@available(
21+
*,
22+
deprecated,
23+
message: "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)."
24+
)
1525
struct ImageGenerationInstance {
1626
let prompt: String
1727
}
1828

29+
/// @DeprecationSummary {
30+
/// All Imagen models are deprecated and will shut down as early as June 2026.
31+
/// As a replacement, you can [migrate your apps to use Gemini Image models
32+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
33+
/// }
34+
@available(
35+
*,
36+
deprecated,
37+
message: "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)."
38+
)
1939
extension ImageGenerationInstance: Equatable {}
2040

2141
// MARK: - Codable Conformance
2242

43+
/// @DeprecationSummary {
44+
/// All Imagen models are deprecated and will shut down as early as June 2026.
45+
/// As a replacement, you can [migrate your apps to use Gemini Image models
46+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
47+
/// }
48+
@available(
49+
*,
50+
deprecated,
51+
message: "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)."
52+
)
2353
extension ImageGenerationInstance: Encodable {}

FirebaseAI/Sources/Types/Internal/Imagen/ImageGenerationOutputOptions.swift

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,43 @@
1414

1515
import Foundation
1616

17+
/// @DeprecationSummary {
18+
/// All Imagen models are deprecated and will shut down as early as June 2026.
19+
/// As a replacement, you can [migrate your apps to use Gemini Image models
20+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
21+
/// }
22+
@available(
23+
*,
24+
deprecated,
25+
message: "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)."
26+
)
1727
struct ImageGenerationOutputOptions {
1828
let mimeType: String
1929
let compressionQuality: Int?
2030
}
2131

32+
/// @DeprecationSummary {
33+
/// All Imagen models are deprecated and will shut down as early as June 2026.
34+
/// As a replacement, you can [migrate your apps to use Gemini Image models
35+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
36+
/// }
37+
@available(
38+
*,
39+
deprecated,
40+
message: "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)."
41+
)
2242
extension ImageGenerationOutputOptions: Equatable {}
2343

2444
// MARK: - Codable Conformance
2545

46+
/// @DeprecationSummary {
47+
/// All Imagen models are deprecated and will shut down as early as June 2026.
48+
/// As a replacement, you can [migrate your apps to use Gemini Image models
49+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
50+
/// }
51+
@available(
52+
*,
53+
deprecated,
54+
message: "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)."
55+
)
2656
extension ImageGenerationOutputOptions: Encodable {}

FirebaseAI/Sources/Types/Internal/Imagen/ImageGenerationParameters.swift

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
/// @DeprecationSummary {
16+
/// All Imagen models are deprecated and will shut down as early as June 2026.
17+
/// As a replacement, you can [migrate your apps to use Gemini Image models
18+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
19+
/// }
20+
@available(
21+
*,
22+
deprecated,
23+
message: "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)."
24+
)
1525
struct ImageGenerationParameters {
1626
let sampleCount: Int?
1727
let storageURI: String?
@@ -25,10 +35,30 @@ struct ImageGenerationParameters {
2535
let includeSafetyAttributes: Bool?
2636
}
2737

38+
/// @DeprecationSummary {
39+
/// All Imagen models are deprecated and will shut down as early as June 2026.
40+
/// As a replacement, you can [migrate your apps to use Gemini Image models
41+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
42+
/// }
43+
@available(
44+
*,
45+
deprecated,
46+
message: "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)."
47+
)
2848
extension ImageGenerationParameters: Equatable {}
2949

3050
// MARK: - Codable Conformance
3151

52+
/// @DeprecationSummary {
53+
/// All Imagen models are deprecated and will shut down as early as June 2026.
54+
/// As a replacement, you can [migrate your apps to use Gemini Image models
55+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
56+
/// }
57+
@available(
58+
*,
59+
deprecated,
60+
message: "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)."
61+
)
3262
extension ImageGenerationParameters: Encodable {
3363
enum CodingKeys: String, CodingKey {
3464
case sampleCount

FirebaseAI/Sources/Types/Internal/Imagen/ImagenConstants.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,30 @@
1515
import Foundation
1616

1717
extension Constants {
18+
/// @DeprecationSummary {
19+
/// All Imagen models are deprecated and will shut down as early as June 2026.
20+
/// As a replacement, you can [migrate your apps to use Gemini Image models
21+
/// (the "Nano Banana"
22+
/// models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
23+
/// }
24+
@available(
25+
*,
26+
deprecated,
27+
message: "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)."
28+
)
1829
enum Imagen {}
1930
}
2031

32+
/// @DeprecationSummary {
33+
/// All Imagen models are deprecated and will shut down as early as June 2026.
34+
/// As a replacement, you can [migrate your apps to use Gemini Image models
35+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
36+
/// }
37+
@available(
38+
*,
39+
deprecated,
40+
message: "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)."
41+
)
2142
extension Constants.Imagen {
2243
static let errorDomain = "\(Constants.baseErrorDomain).Imagen"
2344

FirebaseAI/Sources/Types/Internal/Imagen/ImagenGCSImage.swift

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@ import Foundation
1616

1717
/// An image generated by Imagen, stored in Cloud Storage (GCS) for Firebase.
1818
///
19-
/// TODO(#14451): Make this `public` and move to the `Public` directory when ready.
19+
/// @DeprecationSummary {
20+
/// All Imagen models are deprecated and will shut down as early as June 2026.
21+
/// As a replacement, you can [migrate your apps to use Gemini Image models
22+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
23+
/// }
24+
@available(
25+
*,
26+
deprecated,
27+
message: "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)."
28+
)
2029
struct ImagenGCSImage: Sendable {
2130
/// The IANA standard MIME type of the image file; either `"image/png"` or `"image/jpeg"`.
2231
///
@@ -35,6 +44,16 @@ struct ImagenGCSImage: Sendable {
3544
}
3645
}
3746

47+
/// @DeprecationSummary {
48+
/// All Imagen models are deprecated and will shut down as early as June 2026.
49+
/// As a replacement, you can [migrate your apps to use Gemini Image models
50+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
51+
/// }
52+
@available(
53+
*,
54+
deprecated,
55+
message: "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)."
56+
)
3857
extension ImagenGCSImage: ImagenImageRepresentable {
3958
// TODO(andrewheard): Make this public when the SDK supports Imagen operations that take images as
4059
// input (upscaling / editing).
@@ -43,10 +62,30 @@ extension ImagenGCSImage: ImagenImageRepresentable {
4362
}
4463
}
4564

65+
/// @DeprecationSummary {
66+
/// All Imagen models are deprecated and will shut down as early as June 2026.
67+
/// As a replacement, you can [migrate your apps to use Gemini Image models
68+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
69+
/// }
70+
@available(
71+
*,
72+
deprecated,
73+
message: "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)."
74+
)
4675
extension ImagenGCSImage: Equatable {}
4776

4877
// MARK: - Codable Conformances
4978

79+
/// @DeprecationSummary {
80+
/// All Imagen models are deprecated and will shut down as early as June 2026.
81+
/// As a replacement, you can [migrate your apps to use Gemini Image models
82+
/// (the "Nano Banana" models).](https://firebase.google.com/docs/ai-logic/imagen-models-migration)
83+
/// }
84+
@available(
85+
*,
86+
deprecated,
87+
message: "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)."
88+
)
5089
extension ImagenGCSImage: Decodable {
5190
enum CodingKeys: String, CodingKey {
5291
case mimeType

0 commit comments

Comments
 (0)