ImagenModelFutures

@PublicPreviewAPI
abstract classImagenModelFutures


Wrapper class providing Java compatible methods forImagenModel.

See also
ImagenModel

Summary

Public companion functions

ImagenModelFutures
from(model: ImagenModel)

Public functions

abstractListenableFuture<ImagenGenerationResponse<ImagenInlineImage>>
editImage(referenceImages: List<ImagenReferenceImage>, prompt: String)

Generates an image from a single or set of base images, returning the result directly to the caller.

abstractListenableFuture<ImagenGenerationResponse<ImagenInlineImage>>
editImage(
    referenceImages: List<ImagenReferenceImage>,
    prompt: String,
    config: ImagenEditingConfig?
)

Generates an image from a single or set of base images, returning the result directly to the caller.

abstractListenableFuture<ImagenGenerationResponse<ImagenInlineImage>>

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

abstractImagenModel

Returns theImagenModel object wrapped by this object.

abstractListenableFuture<ImagenGenerationResponse<ImagenInlineImage>>
inpaintImage(
    image: ImagenInlineImage,
    prompt: String,
    mask: ImagenMaskReference,
    config: ImagenEditingConfig
)

Generates an image by inpainting a masked off part of a base image.

abstractListenableFuture<ImagenGenerationResponse<ImagenInlineImage>>
outpaintImage(
    image: ImagenInlineImage,
    newDimensions: Dimensions,
    newPosition: ImagenImagePlacement,
    prompt: String,
    config: ImagenEditingConfig?
)

Generates an image by outpainting the image, extending its borders

Public companion functions

from

fun from(model: ImagenModel): ImagenModelFutures
Returns
ImagenModelFutures

aImagenModelFutures created around the providedImagenModel

Public functions

editImage

abstract fun editImage(referenceImages: List<ImagenReferenceImage>, prompt: String): ListenableFuture<ImagenGenerationResponse<ImagenInlineImage>>

Generates an image from a single or set of base images, returning the result directly to the caller.

Parameters
referenceImages: List<ImagenReferenceImage>

the image inputs given to the model as a prompt

prompt: String

the text input given to the model as a prompt

editImage

abstract fun editImage(
    referenceImages: List<ImagenReferenceImage>,
    prompt: String,
    config: ImagenEditingConfig? = null
): ListenableFuture<ImagenGenerationResponse<ImagenInlineImage>>

Generates an image from a single or set of base images, returning the result directly to the caller.

Parameters
referenceImages: List<ImagenReferenceImage>

the image inputs given to the model as a prompt

prompt: String

the text input given to the model as a prompt

config: ImagenEditingConfig? = null

the editing configuration settings

generateImages

abstract fun generateImages(prompt: String): ListenableFuture<ImagenGenerationResponse<ImagenInlineImage>>

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

Parameters
prompt: String

The main text prompt from which the image is generated.

getImageModel

abstract fun getImageModel(): ImagenModel

Returns theImagenModel object wrapped by this object.

inpaintImage

abstract fun inpaintImage(
    image: ImagenInlineImage,
    prompt: String,
    mask: ImagenMaskReference,
    config: ImagenEditingConfig
): ListenableFuture<ImagenGenerationResponse<ImagenInlineImage>>

Generates an image by inpainting a masked off part of a base image.

Parameters
image: ImagenInlineImage

the base image

prompt: String

the text input given to the model as a prompt

mask: ImagenMaskReference

the mask which defines where in the image can be painted by imagen.

config: ImagenEditingConfig

the editing configuration settings, it should include anImagenEditMode

outpaintImage

abstract fun outpaintImage(
    image: ImagenInlineImage,
    newDimensions: Dimensions,
    newPosition: ImagenImagePlacement = ImagenImagePlacement.CENTER,
    prompt: String = "",
    config: ImagenEditingConfig? = null
): ListenableFuture<ImagenGenerationResponse<ImagenInlineImage>>

Generates an image by outpainting the image, extending its borders

Parameters
image: ImagenInlineImage

the base image

newDimensions: Dimensions

the new dimensions for the image,must be larger than the original image.

newPosition: ImagenImagePlacement = ImagenImagePlacement.CENTER

the placement of the base image within the new image. This can either be coordinates (0,0 is the top left corner) or an alignment (ex:ImagenImagePlacement.BOTTOM_CENTER)

prompt: String = ""

optional, but can be used to specify the background generated if context is insufficient

config: ImagenEditingConfig? = null

the editing configuration settings

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-08 UTC.