TemplateImagenModel

@PublicPreviewAPI
class TemplateImagenModel


Represents a generative model (like Imagen), capable of generating images based a template.

See the documentation for a list of supported models.

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)

Summary

Public functions

suspend ImagenGenerationResponse<ImagenInlineImage>
generateImages(templateId: String, inputs: Map<StringAny>)

This function is deprecated. All Imagen models are deprecated.

Public functions

generateImages

suspend fun generateImages(templateId: String, inputs: Map<StringAny>): ImagenGenerationResponse<ImagenInlineImage>

Generates an image, returning the result directly to the caller.

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)

Parameters
templateId: String

The ID of server prompt template.

inputs: Map<StringAny>

the inputs needed to fill in the prompt