Token导航 LogoToken导航TokenDH.com
开发敏感数据clawhub未标认证来源可访问clear审计提醒

banana-apibanana API 文档

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

9,204

周安装

376

GitHub Stars

公开资料未说明

下载量

2,978
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:banana-api(banana API 文档)
来源仓库:https://github.com/jasonboi/banana-api
安装命令:
openclaw skills install banana-api
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install banana-api

简介

banana-api 用于辅助 API 设计、接口文档、请求响应结构和服务集成说明,适合梳理 endpoint 和生成 OpenAPI 草稿。

  • 支持图像生成与编辑,基于 Nano Banana (Gemini-3-Pro-Image-Preview) API,适用于 Discord 集成和媒体处理场景。
  • 通过 clawhub 安装,命令为 openclaw skills install banana-api,需从现有代码或样例中提取事实避免虚构字段。
  • 使用时需明确鉴权方式、分页规则和错误处理机制,确保接口语义真实准确。
  • 主要功能包括 Base64 编解码、图像压缩和批量变体生成等图像处理能力。

SKILL.md

name
banana-api
description
Generate and edit images using Nano Banana (Gemini-3-Pro-Image-Preview) API. Handles automatic base64 encoding/decoding, image compression, and Discord integration. Use when users want to generate AI images via the Nano Banana service, edit existing photos with AI, or need a streamlined workflow for Gemini image generation without manually handling base64.

Banana API - Nano Banana Image Generation

Streamlined client for Nano Banana's Gemini-3-Pro-Image-Preview API. Automatically handles the annoying base64 workflow, image compression, and Discord sending.

What This Skill Solves

The Problem with Gemini API:

  • Input/output is only base64 (no URLs)
  • Large images = massive base64 strings (2MB+)
  • Manual encoding/decoding is painful
  • No built-in Discord integration

This Skill Provides:

  • ✅ Automatic image compression (512px default)
  • ✅ Transparent base64 encoding/decoding
  • ✅ Smart filename generation
  • ✅ Auto-send to Discord
  • ✅ Both text-to-image and image-to-image editing

Quick Start

Text-to-Image

python3 scripts/banana_gen.py "a cute fluffy cat on a window sill"

Image Editing

python3 scripts/banana_gen.py "transform into rock concert scene with leather jacket" \
  --image /path/to/photo.png

With Discord Auto-Send

python3 scripts/banana_gen.py "cyberpunk cityscape at night" \
  --channel-id 1478746465328435412

Configuration

API Key (Choose One)

Option 1: Config File (Recommended - Persistent)

# Interactive setup (stores in ~/.openclaw/workspace/config/banana-api.json)
python3 scripts/banana_gen.py --setup

# Or manually create config file
echo '{"api_key": "sk-your-key-here"}' > ~/.openclaw/workspace/config/banana-api.json

Option 2: Environment Variable

export BANANA_API_KEY="sk-xxxxxxxx"

Option 3: Command Line (One-time)

python3 scripts/banana_gen.py "prompt" --api-key "sk-xxx"

Output Location

Generated images are saved to:

~/.openclaw/workspace/photos/{description}-{timestamp}.png

View Current Config

python3 scripts/banana_gen.py --show-config

Usage Examples

Basic Generation

# Simple prompt
python3 scripts/banana_gen.py "sunset over mountains"

# With aspect ratio hint
python3 scripts/banana_gen.py "portrait of a warrior" --ratio 2:3

# Custom filename tag
python3 scripts/banana_gen.py "cat playing piano" --name cat-piano

Image Editing (Inpainting/Restyle)

# Change setting/outfit
python3 scripts/banana_gen.py "wearing a red dress at the beach" \
  --image ~/photos/portrait.png

# Change background
python3 scripts/banana_gen.py "standing in front of Tokyo skyline at night" \
  --image ~/photos/selfie.png \
  --name tokyo-night

# Artistic transformation
python3 scripts/banana_gen.py "oil painting style, renaissance portrait" \
  --image ~/photos/photo.jpg

Discord Integration

# Auto-send to channel
python3 scripts/banana_gen.py "dragon breathing fire" \
  --channel-id 1478746465328435412

# Auto-send with custom name
python3 scripts/banana_gen.py "cute anime girl with blue hair" \
  --channel-id 1478746465328435412 \
  --name anime-girl

# Save locally only (no Discord)
python3 scripts/banana_gen.py "prompt" --no-send

Advanced Options

# Custom output path
python3 scripts/banana_gen.py "prompt" --output ~/Desktop/my-image.png

# Different model (if available)
python3 scripts/banana_gen.py "prompt" --model gemini-2.5-flash-image

# Full example
python3 scripts/banana_gen.py "wizard casting spell in ancient library" \
  --image ~/photos/me.png \
  --ratio 2:3 \
  --name wizard-me \
  --channel-id 1478746465328435412

Best Practices

Image Editing Tips

  1. Compress input automatically: Script resizes to 512px by default
  2. Be specific: "wearing black leather jacket" > "cool outfit"
  3. Preserve identity: Face features are usually maintained well
  4. Aspect ratio: Add to prompt, but actual output depends on model

Prompt Engineering

  • Style keywords: "oil painting", "anime style", "photorealistic"
  • Lighting: "dramatic lighting", "soft golden hour", "neon lights"
  • Quality: "high quality", "detailed", "8k"

File Naming

The script auto-generates filenames:

  • Format: banana-{description}-{timestamp}.png
  • Description is cleaned from prompt (first 30 chars)
  • Use --name for custom suffix: banana-{name}-{timestamp}.png

Technical Details

Image Processing Pipeline

Input Image → Resize to 512px → JPEG compress (85%) → Base64 encode → API
                                              ↓
Output ← Base64 decode ← PNG save ← Response

API Flow

1. Compress input image (if provided)
2. Build Gemini API request with base64 inlineData
3. POST to /v1beta/models/{model}:generateContent
4. Extract image from response.candidates[0].content.parts
5. Decode base64 and save to workspace/photos/
6. Send to Discord (if channel-id provided)

Error Handling

  • Input file not found → Clear error message
  • API key missing → Prompt to set BANANA_API_KEY
  • Image too large → Automatic compression
  • API error → JSON error details printed
  • Discord send fail → Warning but continues

Limitations

  • Output always base64: Cannot be changed (Gemini limitation)
  • No URL input: Must download images locally first
  • Single image output: Gemini returns one image per request
  • Response time: 10-60 seconds depending on complexity

When to Use This vs Other Tools

Use CaseRecommended Tool
Quick Gemini imagebanana-api
ComfyUI workflowscomfyui-gen
DALL-E / OpenAIUse their direct API
Stable Diffusioncomfyui-gen

Troubleshooting

ProblemSolution
"PIL not available"Install: pip install Pillow
"API key required"Run --setup to save key, or set BANANA_API_KEY env var
"No image data found"Model may have returned text only; try different prompt
Large output filesNormal for high-res images (500KB-2MB)
Discord send failsCheck channel ID and openclaw CLI access

Configuration Priority

API Key is loaded in this order (first found wins):

  1. --api-key command line argument
  2. BANANA_API_KEY environment variable
  3. ~/.openclaw/workspace/config/banana-api.json config file
  4. ❌ Error if none found

To persist the API key for future use:

python3 scripts/banana_gen.py --setup

Script Reference

python3 scripts/banana_gen.py [PROMPT] [OPTIONS]

Options:
  --image, -i PATH       Input image for editing
  --ratio, -r RATIO      Aspect ratio hint (e.g., 2:3, 16:9)
  --model, -m MODEL      Model name (default: gemini-3-pro-image-preview)
  --output, -o PATH      Custom output path
  --name, -n NAME        Filename suffix/tag
  --channel-id, -c ID    Discord channel ID to auto-send
  --no-send              Skip Discord sending
  --api-key, -k KEY      API key (or set BANANA_API_KEY)
  --setup                Interactive setup to save API key
  --show-config          Display current configuration

Integration with Workflows

As Part of a Larger Pipeline

# Generate + send + reference
IMAGE=$(python3 scripts/banana_gen.py "cute cat" --name kitty | grep "OUTPUT_PATH:" | cut -d: -f2-)
echo "Generated: $IMAGE"

From Another Skill

Call the script directly:

import subprocess
result = subprocess.run([
    'python3', 'scripts/banana_gen.py',
    'prompt here',
    '--image', input_path,
    '--channel-id', channel_id
], capture_output=True, text=True)

适合场景

01

文本生成图片

02

图片风格化

03

产品图和创意图

04

需要 FLUX 模型时

能力概览

能力 1

调用 FLUX 图像模型

能力 2

支持文本生图和图像改写

能力 3

覆盖 LoRA 或风格适配

能力 4

适合创意视觉生成

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

76.62%
按下载量换算2,282

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills