Class ImagenModel

java.lang.Object
com.google.genkit.plugins.googlegenai.ImagenModel
All Implemented Interfaces:
Model, Action<ModelRequest,ModelResponse,ModelResponseChunk>, Registerable

public class ImagenModel extends Object implements Model
Imagen model implementation for image generation using the official Google GenAI SDK.

Imagen is Google's text-to-image model that generates high-quality images from text prompts.

Configuration options (passed via request.config):

  • numberOfImages - Number of images to generate (1-4)
  • aspectRatio - Aspect ratio: "1:1", "3:4", "4:3", "9:16", "16:9"
  • personGeneration - Control people generation: "dont_allow", "allow_adult", "allow_all"
  • negativePrompt - Description of what to avoid in the generated images
  • outputMimeType - MIME type of output: "image/png" or "image/jpeg"