Stay organized with collections Save and categorize content based on your preferences.
ImagenModel@PublicPreviewAPI
class ImagenModel
Represents a generative model (like Imagen), capable of generating images based on various input types.
Summary Public functionssuspend 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.
suspend ImagenGenerationResponse<ImagenInlineImage>
generateImages(prompt: String)
Generates an image, returning the result directly to the caller.
suspend ImagenGenerationResponse<ImagenInlineImage>
inpaintImage(
image: ImagenInlineImage,
prompt: String,
mask: ImagenMaskReference,
config: ImagenEditingConfig
)
Generates an image by inpainting a masked off part of a base image.
suspend ImagenGenerationResponse<ImagenInlineImage>
outpaintImage(
image: ImagenInlineImage,
newDimensions: Dimensions,
newPosition: ImagenImagePlacement,
prompt: String,
config: ImagenEditingConfig?
)
Generates an image by outpainting the given image, extending its content beyond the original borders using context from the original image, and optionally, the prompt.
Public functions outpaintImagesuspend fun outpaintImage(
image: ImagenInlineImage,
newDimensions: Dimensions,
newPosition: ImagenImagePlacement = ImagenImagePlacement.CENTER,
prompt: String = "",
config: ImagenEditingConfig? = null
): ImagenGenerationResponse<ImagenInlineImage>
Generates an image by outpainting the given image, extending its content beyond the original borders using context from the original image, and optionally, the prompt.
Parametersimage: 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, 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 the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-08 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-08 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4