Przejdź do treści
Biblioteka skilli
Marketing i treści · Budowanie i kod

image-gen

/image-gen

Generuje obrazy, ilustracje, diagramy i sceny modelem Nano Banana (Gemini Flash Image) przez OpenRouter.

Repozytorium
raven ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
27.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co robi i kiedy

Generuje obrazy, ilustracje, diagramy i sceny modelem Nano Banana (Gemini Flash Image) przez OpenRouter.

Oryginalny opis (EN)

Generate images via Nano Banana (Gemini 2.5/3.1 Flash Image) on OpenRouter. Use when the user asks to draw, illustrate, render or generate any kind of picture/diagram/scene.

Jak działa

  1. Quick recipe
  2. Request shape (full)
  3. Response shape
  4. Cost (observed)
  5. When to use this skill
  6. Troubleshooting
Sekcje z nagłówków SKILL.md, w oryginale · 147 linii, 574 słów
Podgląd SKILL.md
---
name: image-gen
description: Generate images via Nano Banana (Gemini 2.5/3.1 Flash Image) on OpenRouter. Use when the user asks to draw, illustrate, render or generate any kind of picture/diagram/scene.
metadata: '{"raven": {"requires": {"env": ["OPENROUTER_API_KEY"]}}}'
---

# image-gen — Nano Banana via OpenRouter

Generates one or more images from a text prompt (and optionally one or more
input images) by calling Google's **Nano Banana** family on OpenRouter:

  - `google/gemini-2.5-flash-image`            — original (Nano Banana)
  - `google/gemini-3.1-flash-image-preview`    — latest (Nano Banana 2)

OpenRouter speaks the OpenAI-compatible chat-completions API for these
models, with two extras:

  1. The request must include `"modalities": ["image", "text"]` so the
     server knows to return image bytes, not just a description.
  2. The response carries images in a top-level ``message.images`` array
     (NOT in ``content`` — that field still holds optional commentary text).

## Quick recipe

```python
import os, base64, json, urllib.request

KEY = os.environ["OPENROUTER_API_KEY"]
MODEL = "google/gemini-2.5-flash-image"   # or 3.1 for "Nano Banana 2"

def generate_image(prompt: str, out_path: str = "out.png") -> str:
    req = urllib.request.Request(
        "https://openrouter.ai/api/v1/chat/completions",
        data=json.dumps({
            "model": MODEL,
            "messages": [{"role": "user", "content": prompt}],
            "modalities": ["image", "text"],
        }).encode(),
        headers={
            "Authorization": f"Bearer {KEY}",
            "Content-Type": "application/json",
        },
        method="POST",
    )
    with urllib.request.urlopen(req, timeout=120) as resp:
        data = json.loads(resp.read())

    msg = data["choices"][0]["message"]
    # ``message.images[i].image_url.url`` is a data URI:
    #   "data:image/png;base64,<base64-bytes>"
    url = msg["images"][0]["image_url"]["url"]
    b64 = url.split(",", 1)[1]
    with open(out_path, "wb") as f:
        f.write(base64.b64decode(b64))

    text_note = msg.get("content") or ""
    return f"Wrote {out_path} ({len(b64)//1024} KB). Model said: {text_note[:200]!r}"
```

## Request shape (full)

```json
{
  "model": "google/gemini-2.5-flash-image",
  "messages": [
    {"role": "user", "content": "A red circle on white background"}
  ],
  "modalities": ["image", "text"]
}
```

For **image input + image output** (edit / vary / extend), use the standard
multipart `content` form OpenAI clients accept. The image part can be either
a remote URL or a base64 data URI:

```python
{
  "role": "user",
  "content": [
    {"type": "text", "text": "Make this watercolor style"},
    {"type": "image_url",
     "image_url": {"url": "data:image/png;base64,iVBORw0KGgo..."}}
  ]
}
```

## Response shape

```json
{
  "choices": [{
    "message": {
      "role": "assistant",
      "content": "optional text commentary",
      "images": [
        {
          "type": "image_url",
          "image_url": {
            "url": "data:image/png;base64,<bytes>"
          }
        }
      ]
    }
  }],
  "usage": {
    "prompt_tokens": 8,
    "completion_tokens": 1295,
    "total_tokens": 1303,
    "cost": 0.0383,
    "completion_tokens_details": {"image_tokens": 1290}
  }
}
```

## Cost (observed)

  ~**$0.04 per 1024×1024 PNG** at the time of writing
  (1290 image tokens × $0.00003/tok via the v2.5 flash-image model).
  Burst test: 10 images ≈ **$0.40**. Budget gates accordingly when looping
  in agent code.

## When to use this skill

Trigger keywords / patterns you should recognize:

  - "generate / create / make / draw / render / illustrate (an image / a picture / a logo / ...)"
  - "show me what X looks like"
  - "design a banner / poster / icon for ..."
  - "make it watercolor / cyberpunk / pencil sketch / pixel art" (edit existing)
  - "vary this image" / "more like this but with ..."

Don't use this skill for:

  - **Charts / plots from data** → prefer a Python plotting skill
    (matplotlib / plotly) rather than a generative image. Charts need
    accurate numbers; Nano Banana will hallucinate axes.
  - **Diagrams with precise structure** (UML, DAGs) → use mermaid /
    graphviz instead.

## Troubleshooting

  - **Empty `images` array**: you forgot `"modalities": ["image", "text"]`.
    OpenRouter falls back to text-only without it.
  - **HTTP 403 with "not available in your region"**: OpenRouter blocks
    Anthropic + some Google models from China-mainland IPs. Set
    ``HTTPS_PROXY`` to a proxy that exits via a non-blocked region.
  - **Response includes `refusal`**: prompt was content-filtered. Rewrite
    the prompt; don't retry the same string.
  - **PNG opens to blank / corrupt**: you wrote the data URI verbatim
    instead of decoding. Always strip the ``"data:image/png;base64,"``
    prefix and ``base64.b64decode`` the rest before writing.

Wersje

RepozytoriumWynikLicencja
Ta strona · evermind-ai/raven100Apache-2.0
chatcut-inc/agent-plugin100Apache-2.0
sma1lboy/rove100MIT
dotslashsimran/simcraft100MIT
MoizIbnYousaf/marketing-cli100MIT
0xsline/OpenChatCut100AGPL-3.0
marswaveai/skills100MIT
nicknisi/claude-plugins100MIT

Migawka bazy z 13.11.2026 · wersja paczki c89be19ee0fe (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100nano-banana
    Generuje i edytuje obrazy AI modelami Google Gemini (seria Nano Banana) przez MCP, w tym grafiki z renderowaniem tekstu, w modelach Nano Banana 2 i Nano Banana.
  • 100nano-banana-image-generator
    Generuje obrazy w Nano Banana (Gemini 2.5 Flash Image): infografiki, diagramy, miniatury i grafiki do social mediów, w cenie 0,039 USD za obraz.
  • 100nano-banana-image-gen
    Generuje obrazy rodziną Nano Banana Google (Gemini 2.5 Flash Image, Nano Banana 2 i Pro) z referencjami postaci i stylu, spójnością postaci i kompozycją z wielu obrazów.
  • 100banana
    Generuje i edytuje obrazy przez Google Gemini (Nano Banana Ultimate): tekst na obraz i edycja wielu obrazów z maksymalnie 14 referencjami.
  • 100nano-banana
    Generuje obrazy Gemini i edytuje je przy użyciu AI w skryptach Pythona uruchamianych przez uv, na prośby o wygenerowanie obrazu, grafiki lub rysunku.
  • 100nano-banana-pro
    Generuje i edytuje obrazy przez Gemini 3 Pro Image (Nano Banana Pro) z kluczem API Gemini: tekst na obraz, edycja pojedynczego obrazu i kompozycja do 14 obrazów.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.