ImagenSubjectReference

@PublicPreviewAPI
class ImagenSubjectReference : ImagenReferenceImage


A reference image for generating an image with a specific subject

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 constructors

ImagenSubjectReference(
    image: ImagenInlineImage,
    referenceId: Int?,
    description: String?,
    subjectType: ImagenSubjectReferenceType?
)

Public constructors

ImagenSubjectReference

ImagenSubjectReference(
    image: ImagenInlineImage,
    referenceId: Int? = null,
    description: String? = null,
    subjectType: ImagenSubjectReferenceType? = null
)
Parameters
image: ImagenInlineImage

the image of the subject

referenceId: Int? = null

the reference ID you can use to reference this subject in your prompt

description: String? = null

the description you can use to reference this subject in your prompt

subjectType: ImagenSubjectReferenceType? = null

the type of the subject