ImagenControlReference

@PublicPreviewAPI
public final class ImagenControlReference extends ImagenReferenceImage


Represents a reference image (provided or generated) to bound the created image via controlled generation.

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

ImagenControlReference(
    @NonNull ImagenControlType type,
    ImagenInlineImage image,
    Integer referenceId,
    Boolean enableComputation,
    Integer superpixelRegionSize,
    Integer superpixelRuler
)

Public constructors

ImagenControlReference

public ImagenControlReference(
    @NonNull ImagenControlType type,
    ImagenInlineImage image,
    Integer referenceId,
    Boolean enableComputation,
    Integer superpixelRegionSize,
    Integer superpixelRuler
)
Parameters
@NonNull ImagenControlType type

the type of control reference image

ImagenInlineImage image

the image provided, required if enableComputation is false

Integer referenceId

the reference ID for this image, to be referenced in the prompt

Boolean enableComputation

requests that the reference image be generated serverside instead of provided

Integer superpixelRegionSize

if type is ImagenControlType.COLOR_SUPERPIXEL and enableComputation is true, this will control the size of each superpixel region in pixels for the generated referenced image

Integer superpixelRuler

if type is ImagenControlType.COLOR_SUPERPIXEL and enableComputation is true, this will control the superpixel smoothness factor for the generated referenced image