nano-banana-pro-openrouter
GitHub为Nano Banana Pro提供确定性的OpenRouter图像生成适配,用于meta-skill执行。支持JSON结构化槽位和纯文本模式,安全处理密钥并输出IMAGE_READY记录,避免非零退出错误。
Trigger Scenarios
Install
npx skills add opensquilla/opensquilla --skill nano-banana-pro-openrouter -g -y
SKILL.md
Frontmatter
{
"name": "nano-banana-pro-openrouter",
"homepage": "https:\/\/clawhub.ai\/skills\/nano-banana-pro-openrouter",
"metadata": {
"opensquilla": {
"risk": "high",
"requires": {
"env": [],
"bins": [
"python3"
],
"config": [
"awesome_webpage.openrouter.api_key_env",
"awesome_webpage.openrouter.base_url",
"awesome_webpage.openrouter.models.image_generation",
"awesome_webpage.output_dir"
]
},
"capabilities": [
"network-write",
"filesystem-write"
]
}
},
"entrypoint": {
"env": {
"{{ with.api_key_env | default('OPENROUTER_API_KEY') }}": "{{ with.api_key | default('') }}"
},
"args": [
"--model",
"{{ with.model | default('google\/gemini-3-pro-image-preview') }}",
"--base-url",
"{{ with.base_url | default('https:\/\/openrouter.ai\/api\/v1') }}",
"--api-key-env",
"{{ with.api_key_env | default('OPENROUTER_API_KEY') }}",
"--output-dir",
"{{ with.output_dir }}",
"--filename",
"{{ with.filename | default('image.png') }}",
"--resolution",
"{{ with.resolution | default('1K') }}",
"--max-images",
"{{ with.max_images | default('6') }}",
"--local-path-prefix",
"{{ with.local_path_prefix | default('project\/assets\/images') }}"
],
"parse": "text",
"stdin": "{{ with.payload | default(with.prompt | default(inputs.user_message)) }}",
"command": "python {baseDir}\/scripts\/openrouter_image.py",
"timeout": 300
},
"provenance": {
"origin": "clawhub-mit0",
"license": "MIT-0",
"upstream_url": "https:\/\/clawhub.ai\/skills\/nano-banana-pro-openrouter",
"maintained_by": "OpenSquilla"
},
"description": "Deterministic OpenRouter image generation adapter for Nano Banana Pro \/ Gemini image models. Use as skill_exec when a meta-skill needs local image files and structured IMAGE_READY records without spawning an LLM agent.",
"user-invocable": false,
"disable-model-invocation": true
}
Nano Banana Pro OpenRouter Adapter
This skill is a deterministic adapter around OpenRouter image generation. It is
intended for meta-skill skill_exec use, not as an open-ended agent surface.
Contract
- Uses an explicit
with.api_keyvalue by injecting it into the configuredwith.api_key_envchild process environment variable; it never renders the key into argv. - Does not read
.envfiles, prompt for credentials, print credentials, or write credentials to disk. - Uses only the model, base URL, output directory, and local path prefix passed by the caller.
- Saves generated image bytes under the supplied output directory.
- Emits one
IMAGE_READY:JSON line per saved image. - On missing config or provider failure, emits
IMAGE_CONFIG_NEEDEDorIMAGE_GENERATION_FAILEDinstead of raising non-zero process errors.
Meta-Skill Payload Mode
When stdin is JSON containing media_slots, image_slots, slots, or
page_outline, the adapter generates image slots and preserves already
downloaded images. Structured slots are preferred over free-form outline text:
{
"requirement_framing": "...",
"media_slots": {"slots": [{"slot_id": "hero-visual", "modality": "image"}]},
"page_outline": "...",
"image_download": "...",
"include_images": "YES",
"visual_style": "..."
}
Existing IMAGE_READY: records in image_download are preserved. If
IMAGE_DOWNLOAD_INCOMPLETE: lists unfilled_slot_ids, only those slots are
generated. If the caller requested images but both structured slots and outline
slot parsing are empty, the adapter synthesizes minimal webpage-safe image
slots from the brief instead of emitting no_image_slots_to_generate.
Plain Prompt Mode
When stdin is plain text, the adapter generates one image using that text as the
prompt and the --filename stem as the slot_id.
Version History
- 7f72a32 Current 2026-07-05 18:39


