Image Generation
The Image Generation tool (image_generate) lets the Spectral agent create images from text descriptions — or transform existing images — all within the agent conversation. No external tools or API keys needed beyond what's already configured.
What It Can Do
| Mode | Description |
|---|---|
| Text-to-image | Describe what you want and the AI generates it |
| Image-to-image | Provide a reference image and a prompt to guide transformation |
| Batch generation | Generate up to 10 variations in a single call |
| Format control | Choose PNG, JPEG, or WebP output with configurable compression |
Basic Usage
Just ask the agent to generate an image:
"Generate a dark-themed dashboard UI mockup with charts and a sidebar"
The agent calls image_generate and the result appears inline in the conversation as an image.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | ✅ | — | Text description of the image to generate |
model | string | ❌ | google/gemini-3.1-flash-lite-image | OpenRouter image model ID |
images | array | ❌ | — | Reference images for image-to-image generation (base64 or data URLs) |
n | number | ❌ | 1 | Number of images to generate (1–10) |
resolution | string | ❌ | — | Resolution tier: 512, 1K, 2K, 4K |
aspect_ratio | string | ❌ | — | Aspect ratio: 1:1, 16:9, 9:16, auto |
size | string | ❌ | — | OpenRouter size shorthand, e.g. 2K or 2048x2048 |
quality | enum | ❌ | — | Quality tier: low, medium, high, auto |
output_format | enum | ❌ | — | Output format: png, jpeg, webp |
background | enum | ❌ | — | Background: transparent, opaque, auto |
output_compression | number | ❌ | — | Compression level (0–100) |
seed | number | ❌ | — | Fixed seed for reproducible results |
Examples
Text-to-Image
"Generate a 16:9 banner image for a SaaS landing page hero section. Dark theme, abstract geometric shapes, blue and purple gradient."
Image-to-Image (Variation)
"Take this screenshot and generate a redesigned version with a modern glassmorphism style."
The agent includes the reference image as a base64 data URL in the images parameter.
Batch Generation
"Generate 4 variations of a logo concept: a stylized letter 'A' with a circuit board pattern. Square format, transparent background."
With Compression Control
"Generate a product photo of a wireless headphone on a white background. Output as JPEG with 85% compression quality."
Resolution Guide
| Resolution | Use Case |
|---|---|
512 | Thumbnails, avatars, icons |
1K | Social media posts, blog images |
2K | Hero images, presentation slides |
4K | Print-quality, high-detail artwork |
Model Selection
The default model (google/gemini-3.1-flash-lite-image) balances speed and quality. For higher-quality output, specify a different model:
"Generate this image using the
stability-ai/stable-diffusion-3.5model"
The agent can use any image model available through OpenRouter's Images API.
Architecture
Agent Conversation
│
▼
image_generate tool
│
▼
OpenRouter Images API
│
▼
Image model (Gemini, SD, etc.)
│
▼
Base64 data URL → inline render in chat
The tool is a local CLI extension — it calls OpenRouter's Images API directly. No backend storage, no database persistence. Generated images appear inline in the agent conversation and can be saved or used in subsequent steps.
When to Use
- UI mockups — generate design concepts before writing code
- Logo & icon concepts — iterate on branding ideas
- Documentation images — create diagrams, screenshots, and illustrations
- Social media assets — generate banners, thumbnails, and post images
- Image variation — redesign existing screenshots or mockups
- Placeholder content — generate filler images during development
Next Steps
- Browser Automation — Take screenshots of generated designs
- Design Extension — Use design systems for polished output
- SEO Analysis — Audit images for SEO after generation