← 返回
内容创作 Key

nanobanana2-apiyi

Generate images via APIYI (Gemini 3.1 Flash Image Preview). Use when user wants to generate images from text descriptions. Supports keyword extraction, promp...
通过APIYI(Gemini 3.1 Flash Image Preview)生成图像。用于根据文本描述生成图片,支持关键词提取与提示词优化。
yunni123
内容创作 clawhub v1.0.2 2 版本 100000 Key: 需要
★ 1
Stars
📥 529
下载
💾 46
安装
2
版本
#latest

概述

Nano Banana 2 (APIYI)

Generate images from text descriptions using APIYI's Gemini 3.1 Flash Image Preview API.

Quick Start

当用户说“生成一张xxx图片 / 帮我生成xxx”时,必须先走中文提示词选择流程(先给选择、再生成;此阶段绝不调用生成 API):

1) 先调用脚本候选输出(不生成):

  • python {baseDir}/scripts/generate_image.py --suggest-zh "<用户需求>"
  • 把返回的 A/B/C 三套“增强中文提示词 + 反向词”发给用户让其选择

2) 用户选择 A/B/C

  • 若用户选择 A(北欧极简方向),再调用:

python {baseDir}/scripts/generate_image.py --suggest-zh-a "<用户需求>"

并把 A1/A2/A3 发给用户二次选择

3) 用户最终确认:版本(A/B/C 或 A1/A2/A3)+ 比例(16:9/9:16/1:1)+ 清晰度(1K/2K)

4) 仅在用户确认后,才调用生成脚本:

  • 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 "简约独居冷色治愈"

Basic Generation

python {baseDir}/scripts/generate_image.py --prompt "你的最终提示词" --filename "output.png" --aspect-ratio "16:9" --size "2K"

Advanced: Prompt Restructuring Workflow

For better results, restructure user description into optimized prompts:

Step 1: Understand User Input

Extract from user's description:

  • Subject: What object/person/scene
  • Style: Illustration, realistic, watercolor, oil painting, minimal, tech, Japanese, Chinese retro, etc.
  • Mood/Atmosphere: Warm, cold, nostalgic, futuristic, cozy, etc.
  • Technical: HD, detailed, close-up, bokeh, etc.

Step 2: Restructure Prompt

Combine elements into English prompt:

Template:

[Subject], [Style], [Mood/Atmosphere], [Lighting], [Material], [Composition], [Technical params]

Example:

  • User: "一只可爱的柴犬坐在樱花树下,水彩画风格,高清细节"
  • Restructured: "A cute柴犬 sitting under a cherry blossom tree, watercolor painting style, soft pastel colors, delicate details, HD quality, illustration aesthetic"

Step 3: Generate

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"

Parameters

ParameterOptionsDefault
-----------------------------
--aspect-ratio1:1, 16:9, 9:1616:9
--size1K, 2K2K

API Key Configuration

Set in ~/.openclaw/openclaw.json:

{
  "skills": {
    "nano-banana2-apiyi": {
      "apiKey": "sk-your-api-key"
    }
  }
}

Or use --api-key flag directly.

Examples

Example 1: Tech Poster

User: "生成一张科技感的数据可视化海报"

Restructured: "Data visualization dashboard with futuristic UI, neon blue and purple color scheme, holographic interface, clean lines, tech poster style, high definition"

Example 2: Vintage Photography

User: "生成一张复古胶片风格的咖啡店照片"

Restructured: "Cozy coffee shop interior, vintage film photography style, warm golden lighting, analog film grain, nostalgic atmosphere, 35mm film look, detailed"

Example 3: Product Shot

User: "帮我生成一个简约的香水瓶商业摄影"

Restructured: "Elegant perfume bottle on clean background, commercial product photography, minimalist style, soft studio lighting, luxury branding, high-end packaging, professional advertising photo"

Notes

  • Always use English prompts for better APIYI performance
  • Use timestamps in filenames: yyyy-mm-dd-hh-mm-ss-name.png
  • The script prints MEDIA: line for auto-attach on supported chat providers
  • Do not read the image back; report the saved path only

版本历史

共 2 个版本

  • v1.0.2 当前
    2026-03-19 11:52 安全 安全
  • v1.0.0
    2026-03-14 04:16

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ark-video-storyboard

yunni123
从场景或参考图像生成故事板和提示词,与用户确认脚本后,可选提交多段视频生成任务
★ 1 📥 541
content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 860 📥 199,821
content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,201