---
name: hermes-image-generation-openrouter
description: "Use and troubleshoot Hermes image generation via OpenRouter/Gemini when FAL.ai is unavailable."
version: 1.0.0
author: Hermes Agent
license: MIT
platforms: [linux]
metadata:
  hermes:
    tags: [image-generation, hermes, openrouter, gemini, telegram, setup]
    created_by: agent
---

# Hermes Image Generation via OpenRouter

Use this skill when Margarita asks to generate pictures, portraits, avatars, visual concepts, illustrations, or when `image_generate` fails with missing `FAL_KEY` / managed FAL requirements.

## Current working setup

The default Hermes profile is configured to route `image_generate` through OpenRouter instead of FAL:

```bash
hermes config set image_gen.provider openrouter
hermes config set image_gen.openrouter.model google/gemini-3-pro-image-preview
hermes config set image_gen.model google/gemini-3-pro-image-preview
```

This works because OpenRouter credentials are already available in the environment/config. A successful verification generated:

```text
provider: openrouter
model: google/gemini-3-pro-image-preview
output: ~/.hermes/cache/images/openrouter_gen_*.png
```

## Normal workflow for user requests

1. Call `image_generate` directly with a clear prompt.
2. Choose aspect ratio:
   - `portrait` for people, avatars, covers, vertical posts;
   - `square` for icons, cards, profile images;
   - `landscape` for banners, scenes, wide concepts.
3. If the user wants a specific person/avatar, include:
   - age, ethnicity/region if relevant, emotional state, hair, clothing, environment, lighting;
   - “realistic, authentic, not a model, no text, no logo” for natural portraits.
4. After generation, use `vision_analyze` to verify visible quality, prompt adherence, absence of unwanted text/artifacts.
5. Deliver in Telegram final response with `MEDIA:/absolute/path/to/file` so it appears as an image.

## Example prompt: client-avatar portrait

```text
Realistic warm portrait photo of a 36-year-old Slavic woman named Alina, thoughtful and sensitive, soft feminine presence, intelligent deep eyes, chestnut shoulder-length hair, natural makeup, cozy cream sweater, sitting near a window with warm daylight, subtle bohemian details, authentic lifestyle photography, calm introspective expression, looks like a real woman, not a model, premium but natural, emotional depth, soft background, no text, no logo
```

Call:

```python
image_generate(prompt="...", aspect_ratio="portrait")
```

## Troubleshooting

### Error: missing FAL_KEY

This means the tool fell back to the FAL provider. Re-set the provider:

```bash
hermes config set image_gen.provider openrouter
hermes config set image_gen.openrouter.model google/gemini-3-pro-image-preview
hermes config set image_gen.model google/gemini-3-pro-image-preview
```

Then retry `image_generate` in the same session; the image tool reads this config live.

### Error: OpenRouter returned no image / model access

Try one of these models in config:

```bash
hermes config set image_gen.openrouter.model google/gemini-3-pro-image-preview
hermes config set image_gen.model google/gemini-3-pro-image-preview
```

If unavailable later, inspect `/usr/local/lib/hermes-agent/plugins/image_gen/openrouter/__init__.py` for the current `_DEFAULT_MODEL_CHAIN` / supported models, or run `hermes tools` → Image Generation.

### Tool not visible

Check:

```bash
hermes tools list | grep image_gen
hermes doctor
```

If toolset is disabled, enable it and start a fresh session:

```bash
hermes tools enable image_gen
```

## Margarita style preferences for generated images

For Cosmos Luminosity visuals, prefer:

- premium natural realism or mystical-practical elegance;
- warm, embodied, tactile imagery;
- no plastic AI gloss unless explicitly requested;
- no fake text/logos in the image;
- emotional depth, symbolic atmosphere, body/state cues;
- for avatars: real-person energy, not fantasy doll aesthetics.

For a “client avatar” image, make it feel like a living woman Margarita can address in audio: конкретная, тёплая, с историей, глазами, внутренней жизнью.

## Verification rule

Never tell Margarita image generation is fixed until an actual image has been generated and viewed/verified. Include the final file as `MEDIA:/path` in Telegram.
