Install
openclaw skills install nanobanana2-apiyiGenerate images via APIYI (Gemini 3.1 Flash Image Preview). Use when user wants to generate images from text descriptions. Supports keyword extraction, promp...
openclaw skills install nanobanana2-apiyiGenerate images from text descriptions using APIYI's Gemini 3.1 Flash Image Preview API.
当用户说“生成一张xxx图片 / 帮我生成xxx”时,必须先走中文提示词选择流程(先给选择、再生成;此阶段绝不调用生成 API):
python {baseDir}/scripts/generate_image.py --suggest-zh "<用户需求>"python {baseDir}/scripts/generate_image.py --suggest-zh-a "<用户需求>"
并把 A1/A2/A3 发给用户二次选择python {baseDir}/scripts/generate_image.py --prompt "<最终提示词>" --aspect-ratio "<比例>" --size "<1K/2K>"说明:APIYI 对英文更友好;如用户追求更稳定/更像参考图,可在第 4 步把“最终中文提示词”再改写为英文 prompt 后生成。
A/B/C 三选一:
python {baseDir}/scripts/generate_image.py --suggest-zh "简约独居冷色治愈"
若用户选 A(北欧极简方向),再给 A1/A2/A3:
python {baseDir}/scripts/generate_image.py --suggest-zh-a "简约独居冷色治愈"
python {baseDir}/scripts/generate_image.py --prompt "你的最终提示词" --filename "output.png" --aspect-ratio "16:9" --size "2K"
For better results, restructure user description into optimized prompts:
Extract from user's description:
Combine elements into English prompt:
Template:
[Subject], [Style], [Mood/Atmosphere], [Lighting], [Material], [Composition], [Technical params]
Example:
python3 {baseDir}/scripts/generate_image.py \
--prompt "A cute dog sitting under cherry blossoms, watercolor style, soft pastel colors, spring atmosphere, HD quality" \
--filename "2026-03-12-16-00-00-sakura-dog.png" \
--aspect-ratio "16:9" \
--size "2K"
| Parameter | Options | Default |
|---|---|---|
--aspect-ratio | 1:1, 16:9, 9:16 | 16:9 |
--size | 1K, 2K | 2K |
Set in ~/.openclaw/openclaw.json:
{
"skills": {
"nano-banana2-apiyi": {
"apiKey": "sk-your-api-key"
}
}
}
Or use --api-key flag directly.
User: "生成一张科技感的数据可视化海报"
Restructured: "Data visualization dashboard with futuristic UI, neon blue and purple color scheme, holographic interface, clean lines, tech poster style, high definition"
User: "生成一张复古胶片风格的咖啡店照片"
Restructured: "Cozy coffee shop interior, vintage film photography style, warm golden lighting, analog film grain, nostalgic atmosphere, 35mm film look, detailed"
User: "帮我生成一个简约的香水瓶商业摄影"
Restructured: "Elegant perfume bottle on clean background, commercial product photography, minimalist style, soft studio lighting, luxury branding, high-end packaging, professional advertising photo"
yyyy-mm-dd-hh-mm-ss-name.pngMEDIA: line for auto-attach on supported chat providers