Image Generation

Create AI-generated images through chat or as part of task execution

💬
User request
Prompt optimization
🎨
Generate (OpenRouter)
☁️
Store in S3
🖼️
Display

Natural Language Requests

Just describe what you want to see

🌅 "Create an image of a sunset over the mountains"
🏠 "Generate a cozy living room in Scandinavian style"
🎨 "Make a watercolor painting of a cat in a garden"

Prompt Optimization

Your simple request becomes a detailed prompt

YOUR REQUEST
"a cat"
OPTIMIZED PROMPT
"A fluffy orange tabby cat with bright green eyes, sitting gracefully on a sunlit windowsill, soft natural lighting, photorealistic style, high detail, warm color palette"

Image Generation in Chat

Request and receive images inline in your Hey Umber conversation

Generating...

U
Hey Umber
Creating image...
Create an image of a cozy coffee shop on a rainy day
I'll create that image for you.
Generating image...
Estimated: 15-20 seconds

Complete

U
Hey Umber
Online
Create an image of a cozy coffee shop on a rainy day
Here's your cozy coffee shop scene.
Prompt: Cozy coffee shop interior on a rainy day, warm lighting, steaming cups, rain on windows...

Image Generation in Tasks

Agents can generate images as part of task enrichment

Travel Task Visualization

Auto-generated destination images for trip planning

Plan Rome Trip In Progress
🏛️
🍝
🌿
Generated by Travel Agent based on itinerary

Product Visualization

Shopping tasks can show product concepts

Find Birthday Gift Researching
🎁
📚
Concept visualizations based on preferences

Vault Gallery

Browse and manage all your generated images in one place

📚 All Items
📓 Notebooks 12
💭 Brainstorms 8
🎨 Generated Images 24
24 images
Cozy coffee shop
🏛️
Rome Colosseum
🌅
Mountain sunset
🌿
Garden scene
🏖️
Beach vacation
🌸
Cherry blossoms
🏜️
Desert landscape
🏔️
Snowy mountains

Image Models

Multiple models available through OpenRouter

Nano Banana DEFAULT
Fast, high-quality generations. Best for general use cases.
~10s $0.02/image
Flux Pro
Premium quality with excellent detail and composition.
~20s $0.05/image
DALL-E 3
OpenAI's model with strong prompt adherence.
~15s $0.04/image
Nano Banana Pro PREMIUM
Enhanced version with better photorealism.
~15s $0.04/image

Aspect Ratios

Choose the right dimensions for your use case

1:1
Square
16:9
Landscape
9:16
Portrait
4:3
Standard

Technical Implementation

Architecture, APIs, and storage details

Phase Overview

Implementation broken into 5 phases

Phase 1: Infrastructure
S3 storage, DynamoDB metadata, presigned URLs
Phase 2: ImageGenerationAgent
Agent class, OpenRouter integration, prompt optimization
Phase 3: Chat Integration
Inline display, streaming status, ImageArtifact component
Phase 4: Task Integration
TaskOutput type, ImageCard, enrichment pipeline
Phase 5: Vault Gallery
Browsing, search, management, deletion

Storage Architecture

S3 + DynamoDB for images and metadata

// S3 Path Structure
s3://ai-pa-generated-images-{env}/
└── {userId}/
└── {imageId}.png

// DynamoDB Schema
{
imageId: string,
userId: string,
prompt: string,
optimizedPrompt: string,
model: string,
s3Key: string,
sourceType: 'chat' | 'task',
createdAt: ISO8601
}
Generation Time
10-30 sec
Depending on model
Cost Range
$0.02-0.05
Per image generated
Max Resolution
1024x1024
1K default, up to 4K
Storage
S3 + CDN
CloudFront delivery
TTL
90 days
Auto-cleanup for unused
Formats
PNG, JPEG
WebP future support

Key Files

Implementation locations in the codebase

Agent: agents/implementations/image-generation/src/ImageGenerationAgent.ts
OpenRouter: agents/implementations/image-generation/src/services/OpenRouterImageService.ts
Prompt Optimizer: agents/implementations/image-generation/src/services/PromptOptimizer.ts
Repository: backend/src/services/generated-images/GeneratedImageRepository.ts
Frontend Card: frontend/src/components/chat/ImageArtifact.tsx
Vault Gallery: frontend/src/components/vault/ImageGalleryView.tsx
← Back to Demo Hub