$npx -y skills add QinghongLin/data2story-skill --skill openrouter-text2imageGenerate images via OpenRouter. Default model openai/gpt-5.4-image-2; any image-modality model can be passed via --model.
| 1 | # openrouter-text2image |
| 2 | |
| 3 | Text → image via OpenRouter. Default model: `openai/gpt-5.4-image-2`. |
| 4 | |
| 5 | Other supported models (override with `--model`): |
| 6 | - `google/gemini-3.1-flash-image-preview` (Nano Banana 2) |
| 7 | - any other OpenRouter image-modality model |
| 8 | |
| 9 | ## Usage |
| 10 | |
| 11 | Resolve `TOOL_DIR` = the directory containing this `SKILL.md`. Commands below use `TOOL_DIR` as a symbolic placeholder; replace it with the resolved, quoted path before running Bash. |
| 12 | |
| 13 | ```bash |
| 14 | export OPENROUTER_API_KEY=sk-or-v1-... |
| 15 | |
| 16 | python3 TOOL_DIR/scripts/generate_image.py \ |
| 17 | --prompt "Editorial illustration: a neon-lit skateboard at dusk, dramatic shadows" \ |
| 18 | --download PROJECT_DIR/assets/teaser.png |
| 19 | ``` |
| 20 | |
| 21 | ## Flags |
| 22 | |
| 23 | | Flag | Default | Description | |
| 24 | |---|---|---| |
| 25 | | `--prompt` | required | Text prompt | |
| 26 | | `--download` | required | Output file path (PNG) | |
| 27 | | `--model` | `openai/gpt-5.4-image-2` | Override with any OpenRouter image-modality model | |
| 28 | |
| 29 | ## Notes |
| 30 | |
| 31 | - Request uses `POST /api/v1/chat/completions` with `modalities: ["image","text"]`. |
| 32 | - Images are returned as base64 data URLs in the assistant message; the script decodes and writes to disk. |
| 33 | - For edits/inpainting, include `messages` with both text and image-URL content parts — the script currently supports text-only prompts. |