AI Image Generator

Test Google Gemini AI image generation service with various prompts and styles

Service Configuration
API Key
Configured
Model
imagen-3.0-generate-002
Environment
production
AI Image Generator
Generate professional images using Google Gemini AI. Perfect for blogs, products, and marketing materials.
Quick Templates
Try these pre-made prompts to see the service in action
Generate Custom Image

71/1000 characters

Usage Examples
Common patterns for using the image generation service

Blog Images

import { useImageGeneration } from '@/hooks/use-image-generation' const { generateBlogImage } = useImageGeneration() // Generate hero image for blog post const heroImage = await generateBlogImage( "Free Boiler Scheme 2025 Guide", "Comprehensive guide to government heating grants", "hero" )

Product Images

const { generateProductImage } = useImageGeneration() // Generate product showcase image const productImage = await generateProductImage( "Worcester Bosch Boiler", "High-efficiency condensing boiler", true // Show in use )

Custom Generation

const { generateImages } = useImageGeneration() // Generate with full control const images = await generateImages("UK home energy assessment", { style: 'professional', size: 'landscape', numberOfImages: 2, outputFormat: 'webp' })
API Endpoint
Direct API access for server-side or external use

POST /api/generate-image

{ "prompt": "Professional boiler installation scene", "style": "professional", "size": "landscape", "numberOfImages": 1, "outputFormat": "jpeg" }

GET /api/generate-image

/api/generate-image?prompt=your%20text&style=professional
Environment Setup
How to configure Google Gemini for image generation

Required Environment Variables

# Google Gemini Configuration GEMINI_API_KEY=your_google_gemini_api_key_here GEMINI_IMAGE_MODEL=imagen-3.0-generate-002 # Optional: Vercel Blob Storage (for image storage) BLOB_READ_WRITE_TOKEN=your_vercel_blob_token

Getting Your API Key

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Create a new API key
  4. Copy the key and add it to your .env.local file
  5. Restart your development server

This is a test page for development. Remove or protect in production.

Hover to see all actions