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 and advanced prompt understanding for photorealistic and artistic image creation.
Google Imagen API Reference
Pipecat’s API methods for Google Imagen integration
Example Implementation
Browse examples using Google Imagen
Google Imagen Documentation
Official Google Imagen API documentation and guides
Google Cloud Console
Access Imagen models and manage API keys
Installation
To use Google Imagen services, install the required dependencies:Prerequisites
Google Cloud Setup
Before using Google Imagen services, you need:- Google Cloud Account: Set up at Google Cloud Console
- API Key: Generate a Google API key with Vertex AI access
- Project Configuration: Enable Vertex AI API for your project
- Model Access: Ensure access to Imagen generation models
Required Environment Variables
GOOGLE_API_KEY: Your Google API key for authentication
Configuration
Google AI API key for authentication.
Configuration parameters for image generation. Deprecated in v0.0.105. Use
settings=GoogleImageGenService.Settings(...) instead.HTTP options for the Google AI client.
Runtime-configurable generation settings. See Settings below.
Settings
Runtime-configurable settings passed via thesettings constructor argument using GoogleImageGenService.Settings(...). See Service Settings for details.
| Parameter | Type | Default | Description |
|---|---|---|---|
model | str | NOT_GIVEN | Google Imagen model identifier. (Inherited from base settings.) |
number_of_images | int | NOT_GIVEN | Number of images to generate (1-8). |
negative_prompt | str | None | NOT_GIVEN | Optional negative prompt to guide what not to include in the generated image. |
NOT_GIVEN values are omitted from the request, letting the service use its
own defaults ("imagen-3.0-generate-002" for model, 1 for
number_of_images). Only parameters that are explicitly set are included.Usage
Basic Setup
With Settings
Notes
- No HTTP session needed: Unlike OpenAI and fal, Google returns image data directly in the API response, so no separate HTTP session is required for downloading.
- Negative prompts: Use the
negative_promptparameter to specify what should not appear in the generated image, giving you more control over the output. - Metrics support: Google Imagen supports TTFB metrics tracking.