recontext Image
public CompletableFuture<RecontextImageResponse> recontextImage(String model, RecontextImageSource source, RecontextImageConfig config)
Asynchronously recontextualizes an image.
There is one type of recontextualization currently supported: 1) Virtual Try-On: Generate images of persons modeling fashion products.
Return
a com.google.genai.types.RecontextImageResponse instance that contains the generated images.
Parameters
model
the name of the GenAI model to use for image recontext
source
a com.google.genai.types.RecontextImageSource An object containing the source inputs (prompt, personImage, productImages) for image recontext. prompt is behind an allowlist. personImage is required. productImages is required. Only one product image is supported currently.
config
a com.google.genai.types.RecontextImageConfig instance that specifies the optional configurations