Google Imagen
Image generation service implementation using Google’s Imagen models
Overview
GoogleImageGenService
provides high-quality image generation capabilities using Google’s Imagen models. It supports generating multiple images from text prompts with various customization options.
Installation
To use GoogleImageGenService
, install the required dependencies:
You’ll also need to set up your Google API key as an environment variable: GOOGLE_API_KEY
Configuration
Constructor Parameters
Generation parameters configuration
Google API key for authentication
Input Parameters
Number of images to generate (1-8)
Model identifier
Elements to exclude from generation
Input
The service accepts text prompts through its image generation pipeline.
Output Frames
URLImageRawFrame
Generated image URL (null for Google implementation as it returns raw bytes)
Raw image data
Image dimensions (width, height)
Image format (e.g., ‘JPEG’)
ErrorFrame
Error information if generation fails
Usage Example
Frame Flow
Metrics Support
The service supports metrics collection:
- Time to First Byte (TTFB)
- Processing duration
- API response metrics
Model Support
Google’s Imagen service offers different model variants:
Model ID | Description |
---|---|
imagen-3.0-generate-002 | Latest Imagen model with high-quality outputs |
See other available models in Google’s Imagen documentation.