| name | image-ai-generator |
| description | Generates images via Openrouter API using AI image models. Supports two modes: test (cheap model for iteration) and production (high-quality model for final output). Handles prompt construction, API calls, base64 decoding, and file saving. Supports reference images (logos, mascots) for brand-consistent generation.
|
| description_pt-BR | Gera imagens via API do Openrouter usando modelos de IA. Suporta dois modos: test (modelo barato para iteração) e production (modelo de alta qualidade para output final). Cuida da construção de prompts, chamadas de API, decodificação base64 e salvamento de arquivos. Suporta imagens de referência (logos, mascotes) para geração consistente com a marca.
|
| type | script |
| version | 1.0.0 |
| script | {"path":"scripts/generate.py","runtime":"python3","invoke":"python3 {skill_path}/scripts/generate.py --prompt \"{prompt}\" --output \"{output}\" --mode \"{mode}\""} |
| env | ["OPENROUTER_API_KEY"] |
| categories | ["assets","images","ai","generation"] |
Image Generator
When to use
Use the Image Generator when you need to create visual assets from text prompts. This skill calls the Openrouter API with AI image generation models and saves the resulting images locally.
IMPORTANT: Think twice before generating images. Image generation costs money and takes time. Before generating:
- Check if a suitable image already exists in the squad's assets folder
- Check if a web search could find a free/open image that works
- Consider if the image is truly necessary for the content quality
- Only generate when no existing alternative is good enough
- Generate only what you need — never batch-generate "test variations". One image is enough to validate a concept.
Modes
Test mode (--mode test)
- Model:
sourceful/riverflow-v2-fast
- When to use: During iteration, testing layouts, checking composition, reviewing concepts
- Cost: ~R$0.01-0.02 per image (very low)
- Quality: Good enough for layout validation, not for final output
Production mode (--mode production)
- Model:
google/gemini-3.1-flash-image-preview
- When to use: Only when generating the final images that will be published or delivered
- Cost: ~R$0.07-0.10 per image
- Quality: High quality, suitable for social media and publishing
Default mode is test. Only switch to production when the user has approved the layout/composition and you are generating the final deliverable images.
Instructions
Single image generation
python3 skills/image-generator/scripts/generate.py \
--prompt "A detailed description of the image to generate" \
--output "squads/{squad}/output/{run_id}/assets/image-name.jpg" \
--mode test
With a reference image (logo, mascot, brand asset)
Use --reference to send a local image to the model as visual context. The model will incorporate the referenced image (e.g., a logo or mascot) into the generated output.
python3 skills/image-generator/scripts/generate.py \
--prompt \
--output \
--reference \
--mode production