← 返回 Skills 市场
allenfancy-gan

IMA Nano Banana Image Generator

作者 allenfancy-gan · GitHub ↗ · v1.0.9 · MIT-0
cross-platform ✓ 安全检测通过
476
总下载
0
收藏
3
当前安装
9
版本数
在 OpenClaw 中安装
/install ai-nano-banana-ima
功能描述
Nano Banana-only image generation on IMA Open API. Supports text_to_image and image_to_image with gemini-3.1-flash-image (budget) and gemini-3-pro-image (pre...
使用说明 (SKILL.md)

IMA Nano Banana Image Generator

Scope

This skill is for IMA Open API image generation with strict Nano Banana scope:

  • Task types: text_to_image, image_to_image
  • Allowed model IDs only:
    • gemini-3.1-flash-image
    • gemini-3-pro-image
  • Always execute through bundled script: scripts/ima_image_create.py

Out of scope:

  • Video or non-image tasks
  • Non-IMA providers
  • Non-Nano-Banana model families (for example SeeDream, Midjourney)
  • Handcrafted API requests (do not bypass script)

Quick Runbook (Authoritative)

If any later section conflicts with this runbook, follow this runbook.

  1. Confirm request is in scope (IMA + Nano Banana image generation/editing).
  2. Resolve task_type:
    • No reference image -> text_to_image
    • With reference image/edit request -> image_to_image
  3. Resolve model:
    • Premium/best quality -> gemini-3-pro-image
    • Cheapest/budget -> gemini-3.1-flash-image + --size 512
    • Otherwise -> gemini-3.1-flash-image
  4. Resolve parameters:
    • Size -> --size (512,1K,2K,4K)
    • Ratio -> --extra-params JSON (for example {"aspect_ratio":"16:9"})
  5. If user asks 8K, explain unsupported and downgrade to 4K.
  6. For image_to_image, require at least one input image.
  7. For remote image URLs:
    • Prefer https://
    • If user gives http://, ask for https:// URL or local file
  8. Endpoint policy is fixed:
    • Main API: https://api.imastudio.com
    • Upload API: https://imapi.liveme.com
    • No CLI/env override for these domains in this skill.
  9. Run only scripts/ima_image_create.py; do not call API endpoints manually.
  10. Use messaging Step 0-4 flow. If message tool is unavailable, use normal replies with same content.
  11. On success, prefer rendered media output; if media unsupported, return URL + model + elapsed/credit summary.

FAQ (For Ambiguous Inputs)

Q1) How to map intent to task_type?

Situation task_type
Prompt-only generation text_to_image
Edit/transform from URL/local image image_to_image

Q2) How to map user wording to model?

User wording model_id Extra rule
默认 / 平衡 / Banana2 / NB2 gemini-3.1-flash-image none
最便宜 / budget / cheap gemini-3.1-flash-image force --size 512
最好 / 高质量 / Pro / premium gemini-3-pro-image none

Q3) How to set ratio and size?

Target Setting
Size (512,1K,2K,4K) --size
Aspect ratio (1:1,16:9,9:16,4:3,3:4) --extra-params '{"aspect_ratio":"16:9"}'

8K is not supported; downgrade to 4K.

Q4) What placeholder substitutions are required?

  • {baseDir} -> current skill root path
  • {user_id} -> real user/session id string

User-Facing Messaging Protocol

Step 0: Acknowledge immediately

Use a short warm reply in user language, for example:

  • 收到,马上开始生成。
  • OK, generating now.

Step 1: Start notification

🎨 开始生成图片,请稍候…
• 模型:[Model Name]
• 预计耗时:[X~Y 秒]
• 消耗积分:[N pts]

Step 2: Progress notification

Model Typical Duration Poll Interval Push Interval
gemini-3.1-flash-image 20–40s 5s 15s
gemini-3-pro-image 60–120s 5s 30s

Progress format:

⏳ 正在生成中… [P]%
已等待 [elapsed]s,预计最长 [max]s

P = min(95, floor(elapsed / max * 100)) until success.

Step 3: Success notification

✅ 图片生成成功!
• 模型:[Model Name]
• 耗时:预计 [X~Y]s,实际 [actual]s
• 消耗积分:[N pts]
🔗 原始链接:{image_url}

Prefer media attachment; fallback to plain text message if media is not supported.

Step 4: Failure notification

❌ 图片生成失败
• 原因:[natural language reason]
• 建议:[retry strategy or model switch]
需要我帮你重试吗?

After Step 4, stop. Do not send duplicate completion messages.

Command Templates (Minimal)

# 1) List models
python3 {baseDir}/scripts/ima_image_create.py \
  --api-key "$IMA_API_KEY" \
  --task-type text_to_image \
  --list-models

# 2) text_to_image (default/premium/budget/ratio via params)
python3 {baseDir}/scripts/ima_image_create.py \
  --api-key "$IMA_API_KEY" \
  --task-type text_to_image \
  --model-id gemini-3.1-flash-image \
  --prompt "a cute puppy on grass" \
  --size 1K \
  --extra-params '{"aspect_ratio":"1:1"}' \
  --user-id {user_id} \
  --output-json
# Notes:
# - Premium: set --model-id gemini-3-pro-image
# - Cheapest: keep flash model and set --size 512

# 3) image_to_image with remote URL input
python3 {baseDir}/scripts/ima_image_create.py \
  --api-key "$IMA_API_KEY" \
  --task-type image_to_image \
  --model-id gemini-3.1-flash-image \
  --prompt "turn into oil painting" \
  --input-images "https://example.com/photo.jpg" \
  --user-id {user_id} \
  --output-json

# 4) image_to_image with local file input
python3 {baseDir}/scripts/ima_image_create.py \
  --api-key "$IMA_API_KEY" \
  --task-type image_to_image \
  --model-id gemini-3.1-flash-image \
  --prompt "turn into oil painting" \
  --input-images "./local-photo.jpg" \
  --user-id {user_id} \
  --output-json

Security And Data Handling

Network domains

Domain Usage Trigger
api.imastudio.com Product list, create task, poll detail All generation tasks
imapi.liveme.com Upload token + file upload image_to_image with local files

Why two domains?

  • api.imastudio.com: IMA's image generation API (handles task orchestration)
  • imapi.liveme.com: IMA's media storage infrastructure (handles large file uploads)
  • Both services are owned and operated by IMA Studio

Credential flow

Credential Where Sent Why
IMA_API_KEY api.imastudio.com Open API auth (Authorization: Bearer ...)
IMA_API_KEY imapi.liveme.com Upload-token auth for local image uploads

Notes:

  • Upload signing uses shared built-in credentials (same as ima-image-ai skill).
  • No API key is sent to presigned upload hosts during binary upload.
  • API domains are fixed in script and not user-overridable.
  • Never print or persist raw API keys in chat or repo files.

Local persistence

Path Purpose Retention
~/.openclaw/memory/ima_prefs.json Per-user model preference cache Until removed
~/.openclaw/logs/ima_skills/ Operational logs Auto-cleaned after 7 days

Error Handling Playbook

Error pattern User-facing explanation Suggested action
401 / unauthorized API key invalid or unauthorized Regenerate key: https://www.imaclaw.ai/imaclaw/apikey
4008 / insufficient points Credits are insufficient Recharge: https://www.imaclaw.ai/imaclaw/subscription
6009 / 6010 / invalid attribute Parameter-rule mismatch Retry with defaults or lower complexity
timeout Task took too long Retry with faster/lower-cost setup
network / rate limit Temporary connectivity/limit issue Wait and retry

Fallback messages:

  • Chinese: 图片生成遇到问题,请稍后重试或换个模型试试。
  • English: Image generation encountered an issue, please retry or switch model.

Quick Defaults

  1. Default model: gemini-3.1-flash-image
  2. Premium model: gemini-3-pro-image
  3. Cheapest profile: flash model + --size 512
  4. Max output: 4K
  5. Recommended ratios: 1:1, 16:9, 9:16, 4:3, 3:4
安全使用建议
This package appears coherent for an IMA image-generation client, but review these before installing: 1) Use a scoped/test IMA_API_KEY instead of a full-production key until you verify behavior; the key will be sent to both api.imastudio.com and imapi.liveme.com for local-file uploads. 2) Confirm you are comfortable with the skill writing logs and a preferences file under ~/.openclaw (logs may contain URLs and metadata; authors state the API key is not written to disk). 3) Note the hard-coded APP_ID/APP_KEY in the script (authors claim non-secret shared values); verify that upload-token flow meets your security/privacy needs. 4) The registry metadata you were shown has a minor inconsistency about the 'primary credential'—trust the SKILL.md/packaged clawhub.json for runtime requirements. If you need greater assurance, inspect the full ima_image_create.py functions that perform network calls or run the script in an isolated environment first.
功能分析
Type: OpenClaw Skill Name: ai-nano-banana-ima Version: 1.0.9 The IMA Nano Banana Image Generator skill is a functional tool for generating images via the IMA Open API. The bundle includes a Python script (ima_image_create.py) that handles model selection, task creation, and polling, with a robust 'reflection' mechanism for automatic error recovery and parameter degradation. All high-risk behaviors, such as sending the IMA_API_KEY to specific IMA Studio domains (api.imastudio.com and imapi.liveme.com) and persisting logs/preferences in ~/.openclaw/, are clearly disclosed in SKILL.md and SECURITY.md. No evidence of malicious intent, unauthorized data exfiltration, or prompt injection was found.
能力评估
Purpose & Capability
Name/description (IMA Nano Banana image generation) match the artifacts: SKILL.md, scripts/ima_image_create.py implement text_to_image and image_to_image against api.imastudio.com and imapi.liveme.com and enforce a model allowlist. One minor metadata inconsistency exists: the top-level manifest summary you provided states 'Primary credential: none' while SKILL.md and clawhub.json declare IMA_API_KEY as required/primary; this is likely a packaging/metadata mismatch but does not change runtime behavior.
Instruction Scope
SKILL.md explicitly limits operations to the bundled script and to image tasks; the script follows that flow (product list, create task, poll, optional local-file upload). The script reads local image files only when performing image_to_image (expected). It sends the IMA_API_KEY to the two documented IMA domains for task creation and upload-token requests (documented in SECURITY.md). There are no instructions to read unrelated system files or collect other credentials.
Install Mechanism
No network download/install hook or arbitrary remote code execution; this is an instruction+script package with requirements.txt (requests). No high-risk install URLs or extract steps are present.
Credentials
Only one required environment variable (IMA_API_KEY) is requested which matches the service integration. The script will send that API key to api.imastudio.com for generation and to imapi.liveme.com when uploading local files (this dual-domain use is documented in SECURITY.md). The package contains hard-coded APP_ID/APP_KEY used to sign upload-token calls and the code claims these are non-secret; that is plausible but should be understood by the user.
Persistence & Privilege
The skill does write to its own pref and log paths (~/.openclaw/memory/ima_prefs.json and ~/.openclaw/logs/ima_skills/) as declared in SKILL.md/clawhub.json and cleans logs after seven days. always:false and no cross-skill or system-wide config modifications are present.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ai-nano-banana-ima
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ai-nano-banana-ima 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.9
**Changelog for version 1.0.9:** - Added a detailed changelog file: `CHANGELOG_CLAWHUB.md`. - No other changes; functionality remains the same.
v1.0.8
No functional or code changes in this version. - Documentation updates only: SKILL.md rewritten for improved clarity and accuracy. - Local file upload environment/key rules have been removed from the runbook. - Security section now better explains IMA’s two service domains, how credentials are used, and omits local upload signing details. - The command templates and error handling tables have minor edits for accuracy.
v1.0.7
ai-nano-banana-ima 1.0.7 - Added compiled Python bytecode files for image creation and logging (`ima_image_create.cpython-314.pyc`, `ima_logger.cpython-314.pyc`) under `scripts/__pycache__/`. - No changes to skill documentation or user-facing behavior.
v1.0.6
No significant file changes detected. No user-facing changes in this version.
v1.0.5
**Summary:** Added environment variable support, persistent user preferences, log file retention, and improved transparency for technical details upon user request. - Added required environment variable `IMA_API_KEY` and optional `IMA_IM_BASE_URL` for configuration. - Introduced persistent storage for user preferences and logs (auto-cleared after 7 days). - Updated protocol: share script paths/endpoints/parameters if users explicitly ask for technical details. - Default responses remain user-friendly; technical info shown only on request. - No breaking changes to main image generation or user flow.
v1.0.4
- Documentation version reverted from 1.1.0 back to 1.0.0. - Description now specifies "ima_* API key" instead of "IMA API key". - Minor edits to the description; technical references remain unchanged. - No functional or feature changes; this is a doc-only version rollback.
v1.0.3
Version 1.0.3 - Added SECURITY.md to document security and responsible disclosure practices. - No changes to functionality or user experience.
v1.0.1
- Added clawhub.json for integration with OpenClaw platforms. - No other changes to functionality or documentation.
v1.0.0
Initial release: IMA Nano Banana image generation skill. - Adds image generation using only the Nano Banana series (Nano Banana, Nano Banana Pro, Nano Banana 2) via IMA Open API. - Supports both text-to-image and image-to-image tasks, with native aspect ratio handling (1:1, 16:9, 9:16, 4:3, 3:4). - Provides step-by-step, user-friendly notification flow: acknowledgment reply, pre-generation notice, progress updates, result image, and failure messages. - Requires ima_* API key; bundled with scripts/ima_image_create.py for backend processing. - Designed for use in messaging platforms (Feishu, Discord) with detailed, plain-language status and error handling—no technical jargon exposed to users.
元数据
Slug ai-nano-banana-ima
版本 1.0.9
许可证 MIT-0
累计安装 3
当前安装数 3
历史版本数 9
常见问题

IMA Nano Banana Image Generator 是什么?

Nano Banana-only image generation on IMA Open API. Supports text_to_image and image_to_image with gemini-3.1-flash-image (budget) and gemini-3-pro-image (pre... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 476 次。

如何安装 IMA Nano Banana Image Generator?

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

IMA Nano Banana Image Generator 是免费的吗?

是的,IMA Nano Banana Image Generator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

IMA Nano Banana Image Generator 支持哪些平台?

IMA Nano Banana Image Generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 IMA Nano Banana Image Generator?

由 allenfancy-gan(@allenfancy-gan)开发并维护,当前版本 v1.0.9。

💬 留言讨论