AI Gateway

Imagen 4

google/imagen-4.0-generate-001

Imagen 4: Google's flagship text-to-image model that serves as the go-to choice for a wide variety of high-quality image generation tasks, featuring significant improvements in text rendering over previous models. It now supports up to 2K resolution generation for creating detailed and crisp visuals, making it suitable for everything from marketing assets to artistic compositions.

index.ts
import { experimental_generateImage as generateImage } from 'ai';
const result = await generateImage({
model: 'google/imagen-4.0-generate-001',
prompt: 'A red balloon on a wooden table.'
});