Are you sure you want to delete this access key?
This example demonstrates Google Imagen image generation models.
You can run this example with:
npx promptfoo@latest init --example google-imagen
You can use Imagen models through either Google AI Studio or Vertex AI:
seed
or addWatermark
parametersgcloud auth application-default login
# Set your API key (Unix/Linux/macOS)
export GOOGLE_API_KEY=your-api-key
# For Windows Command Prompt:
# set GOOGLE_API_KEY=your-api-key
# For Windows PowerShell:
# $env:GOOGLE_API_KEY="your-api-key"
# Enable Vertex AI API
gcloud services enable aiplatform.googleapis.com
# Authenticate
gcloud auth application-default login
# Set project ID (Unix/Linux/macOS)
export GOOGLE_PROJECT_ID=your-project-id
# For Windows Command Prompt:
# set GOOGLE_PROJECT_ID=your-project-id
# For Windows PowerShell:
# $env:GOOGLE_PROJECT_ID="your-project-id"
GOOGLE_API_KEY
- Google AI Studio API key (Option 1)GOOGLE_PROJECT_ID
- Your Google Cloud project ID (Option 2)imagen-4.0-ultra-generate-preview-06-06
- Ultra quality ($0.06/image)imagen-4.0-generate-preview-06-06
- Standard quality ($0.04/image)imagen-4.0-fast-generate-preview-06-06
- Fast generation ($0.02/image)imagen-3.0-generate-002
- Imagen 3.0 ($0.04/image)npx promptfoo@latest eval
seed
or addWatermark
parametersblock_low_and_above
safety filter levelgcloud auth application-default login
block_most
, block_some
, block_few
, block_fewest
)seed
for deterministic generationaddWatermark
controlGOOGLE_PROJECT_ID
environment variableprojectId
in the provider configSee promptfooconfig-advanced.yaml
for examples of platform-specific configurations that take advantage of each platform's unique capabilities.
Press p or to see the previous file or, n or to see the next file
Browsing data directories saved to S3 is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with AWS S3!
Are you sure you want to delete this access key?
Browsing data directories saved to Google Cloud Storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with Google Cloud Storage!
Are you sure you want to delete this access key?
Browsing data directories saved to Azure Cloud Storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with Azure Cloud Storage!
Are you sure you want to delete this access key?
Browsing data directories saved to S3 compatible storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with your S3 compatible storage!
Are you sure you want to delete this access key?