← 返回 Skills 市场
ruiww

grsai nano-banana 生图技能

作者 Ruiww · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
394
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install grsai-nano-banana
功能描述
使用 grsai 平台的 nano-banana 模型生成图片(支持文生图、图生图)
使用说明 (SKILL.md)

🎨 grsai nano-banana 生图技能

使用 grsai 平台的 nano-banana 系列模型生成高质量图片,支持文生图和图生图。


📋 使用前准备

1. 获取 grsai API Key

  1. 访问 https://grsai.ai/zh/dashboard
  2. 注册/登录账户
  3. 进入 API Key 管理 页面
  4. 创建新的 API Key
  5. 充值 - 确保账户有足够 credits(生图消耗积分)

2. 配置 API Key

方式一:openclaw.json 配置(推荐)

{
  "skills": {
    "entries": {
      "grsai-nano-banana": {
        "apiKey": "sk-your-api-key-here"
      }
    }
  }
}

方式二:环境变量

export G RSAI_API_KEY="sk-your-api-key-here"

🚀 使用方法

方式一:自然语言对话(推荐)

直接告诉助理你的生图需求,助理会引导你确认方案:

用户:帮我生成一张可爱柴犬的头像
助理:好的,使用 nano-banana 生图需要确认以下信息:
      【必填】模型、提示词
      【选填】尺寸、比例、参考图
      ...

方式二:命令行调用

文生图:

uv run ~/.openclaw/workspace/skills/grsai-nano-banana/generate.py \
  --prompt "手绘版可爱柴犬头像" \
  --model "nano-banana-pro" \
  --resolution "1K" \
  --aspect-ratio "1:1" \
  --api-key "sk-xxx"

图生图:

uv run ~/.openclaw/workspace/skills/grsai-nano-banana/generate.py \
  --prompt "把这张图变成油画风格" \
  --input-image "https://example.com/photo.png" \
  --model "nano-banana-pro" \
  --api-key "sk-xxx"

📐 参数说明

必填参数

参数 说明 示例
--prompt 提示词,清晰描述想要的内容 "一只可爱的猫咪在草地上"
--api-key grsai API Key "sk-xxx"

选填参数

参数 默认值 选项 说明
--model nano-banana-pro nano-banana-pro\x3Cbr>nano-banana-fast\x3Cbr>nano-banana-2\x3Cbr>nano-banana-pro-vip 不同模型支持不同分辨率
--resolution 1K 1K / 2K / 4K 分辨率越高,生成时间越长
--aspect-ratio auto auto / 1:1 / 16:9 / 9:16\x3Cbr>4:3 / 3:4 / 3:2 / 2:3\x3Cbr>5:4 / 4:5 / 21:9 输出图片比例
--input-image - 图片 URL 参考图(图生图时使用)
--filename 自动生成 自定义文件名 输出文件名
--output-dir ./generated 目录路径 输出目录(默认相对于当前目录)

⏱️ 生成时间

模型 1K 2K 4K
nano-banana-fast ~2 分钟 ~3 分钟 -
nano-banana-pro ~5-8 分钟 ~8-12 分钟 ~15 分钟

注意:

  • 实际时间取决于 grsai 服务器负载
  • 高峰时段可能需要更长时间
  • 脚本会自动轮询,无需手动等待

📁 输出文件

保存路径: ./generated/(可自定义)

命名规则: yyyymmdd_模型_描述.png

示例:

  • 20260304_pro_手绘版可爱柴犬头像.png
  • 20260304_fast_sunset_beach.png

自定义输出目录:

uv run generate.py --prompt "xxx" --output-dir "/your/custom/path" --api-key "sk-xxx"

⚠️ 常见问题与踩坑记录

1. API 返回 "apikey credits not enough"

原因: 账户余额不足

解决:

  1. 登录 grsai 后台
  2. 检查当前 API Key 对应的账户
  3. 充值 credits

2. 生成超时 "gemini timeout... Please try again later"

原因: grsai 后端生成时间较长

解决:

  • 使用异步轮询模式(脚本默认)
  • 等待 5 分钟后开始轮询
  • 最多轮询 3 次,间隔 1 分钟
  • 如仍失败,稍后重试

3. 内容违规

原因: 提示词包含敏感内容

解决:

  • 调整提示词,避免敏感词汇
  • 使用更委婉的描述方式

4. 模型不支持的分辨率

原因: 某些模型有分辨率限制

限制说明:

  • nano-banana-pro-vip:仅支持 1K、2K
  • nano-banana-pro-4k-vip:仅支持 4K

解决: 选择正确的模型或调整分辨率


5. 接口返回空响应

原因: 请求格式不正确

正确格式:

{
  "model": "nano-banana-pro",
  "prompt": "xxx",
  "imageSize": "1K",
  "aspectRatio": "auto",
  "webHook": "-1",
  "shutProgress": false
}

注意: webHook: "-1" 是关键,让接口立即返回 task_id


6. 查询结果时参数错误

错误: 使用 task_id 参数

正确: 使用 id 参数

{"id": "1-xxxxx"}

🔧 技术细节

API 端点

接口 URL 方法
提交任务 /v1/draw/nano-banana POST
查询结果 /v1/draw/result POST

请求格式

提交任务:

curl -X POST "https://grsai.dakka.com.cn/v1/draw/nano-banana" \
  -H "Authorization: Bearer sk-xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-pro",
    "prompt": "手绘版可爱柴犬头像",
    "imageSize": "1K",
    "aspectRatio": "1:1",
    "webHook": "-1",
    "shutProgress": false
  }'

查询结果:

curl -X POST "https://grsai.dakka.com.cn/v1/draw/result" \
  -H "Authorization: Bearer sk-xxx" \
  -H "Content-Type: application/json" \
  -d '{"id": "1-b834c0d4-dda7-4ab2-9ce6-378ea325ab3a"}'

响应格式

提交成功:

{
  "code": 0,
  "data": {
    "id": "1-b834c0d4-dda7-4ab2-9ce6-378ea325ab3a"
  },
  "msg": "success"
}

查询成功:

{
  "code": 0,
  "data": {
    "id": "1-xxxxx",
    "status": "succeeded",
    "progress": 100,
    "results": [{
      "url": "https://file3.aitohumanize.com/file/xxx.png"
    }]
  },
  "msg": "success"
}

📝 更新日志

  • 2026-03-04 - 初始版本
    • 支持文生图、图生图
    • 异步轮询模式
    • 自动保存至 ./generated/ 目录
    • 智能文件命名

🔗 相关链接

  • grsai 官网:https://grsai.ai/
  • grsai 后台:https://grsai.ai/zh/dashboard
  • 文档:https://grsai.ai/zh/dashboard/documents/nano-banana
安全使用建议
This skill appears to do what it says (submit image-generation jobs and download results) but there are a few inconsistencies you should verify before installing or providing an API key: 1) Confirm the correct API host — SKILL.md and generate.py default to https://grsai.dakka.com.cn while the homepage is https://grsai.ai; verify whether grsai.dakka.com.cn is an official backend for grsai. 2) The declared primary environment variable name contains a space ("G RSAI_API_KEY"); that is almost certainly a typo — ask the author whether the intended name is something like GRSAI_API_KEY or G_RSAI_API_KEY. 3) decide how you will supply the API key (openclaw.json, environment variable, or CLI flag) and avoid storing keys in less secure locations. 4) Review the generate.py script yourself (it is included) and, if you will run it locally, run it in a controlled environment; the script only makes network requests to submit/poll/download images, but you should confirm the endpoints and TLS certs for authenticity. If you cannot confirm the host/variable issues, treat the skill as untrusted and do not provide production API keys.
功能分析
Type: OpenClaw Skill Name: grsai-nano-banana Version: 1.0.0 The skill's primary function is benign, facilitating image generation via the grsai platform. However, the `generate.py` script allows users to specify an arbitrary `--output-dir` and `--filename` for saving generated images. While this functionality is plausible for the stated purpose, it introduces a vulnerability where a malicious actor could potentially craft these arguments (e.g., via prompt injection to the OpenClaw agent) to write files to arbitrary locations on the system, potentially overwriting critical files if the agent runs with elevated privileges and lacks strict path validation. This constitutes a risky capability without clear malicious intent within the script itself, classifying it as suspicious.
能力评估
Purpose & Capability
Name/description (generate images with grsai nano-banana) align with the included script and instructions. The skill declares required binaries uv and curl — uv is used to run the Python script and curl is used in examples (not in the script). However metadata lists a primary credential named "G RSAI_API_KEY" (contains a space) which does not match common env var naming conventions and differs from other locations where the API key is described (openclaw.json or --api-key CLI flag). These naming mismatches are likely typos but are incoherent and should be corrected.
Instruction Scope
SKILL.md and generate.py restrict actions to: submitting tasks to a grsai API, polling results, and downloading images to a local ./generated/ directory. There are no instructions to read unrelated local files, harvest other environment variables, or transmit arbitrary local data. The agent instructions do show curl examples and advise storing API key in openclaw.json or an environment variable.
Install Mechanism
No install spec is provided (instruction-only with a python script included). That is low-risk. The Python script depends on the 'requests' package; the script prints a helpful message if requests is missing. No remote download or archive extraction is performed by the skill itself.
Credentials
The only credential needed is an API key for grsai, which is proportionate. However the declared primaryEnv name "G RSAI_API_KEY" contains a space and likely is a mistake; SKILL.md also shows using an openclaw.json entry and an environment variable export with that same malformed name. generate.py itself requires the API key via a CLI flag (--api-key). The inconsistency in how the key is provided (env var name vs openclaw.json vs CLI) should be clarified to avoid accidentally storing the key in an unexpected location. No other unrelated secrets are requested.
Persistence & Privilege
The skill does not request always:true and does not attempt to modify other skills or system settings. It only writes generated images to a local output directory specified by the user (default ./generated). Autonomous invocation is allowed (platform default) but not elevated here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install grsai-nano-banana
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /grsai-nano-banana 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
初始版本 - 支持文生图/图生图,异步轮询,自动保存
元数据
Slug grsai-nano-banana
版本 1.0.0
许可证
累计安装 1
当前安装数 0
历史版本数 1
常见问题

grsai nano-banana 生图技能 是什么?

使用 grsai 平台的 nano-banana 模型生成图片(支持文生图、图生图). 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 394 次。

如何安装 grsai nano-banana 生图技能?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install grsai-nano-banana」即可一键安装,无需额外配置。

grsai nano-banana 生图技能 是免费的吗?

是的,grsai nano-banana 生图技能 完全免费(开源免费),可自由下载、安装和使用。

grsai nano-banana 生图技能 支持哪些平台?

grsai nano-banana 生图技能 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 grsai nano-banana 生图技能?

由 Ruiww(@ruiww)开发并维护,当前版本 v1.0.0。

💬 留言讨论