npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

comet-nanobanana-zijie

v1.0.3

Published

MCP server for Comet API Nano Banana image generation and editing

Downloads

9

Readme

Comet Nano Banana MCP

基于 Comet API 的 Nano Banana (Gemini 3 Pro Image) 图片生成和编辑 MCP 服务器。

功能特性

  • 文生图 (text_to_image): 根据文本描述生成高质量图片
  • 图片编辑 (edit_image): 基于输入图片和文本提示进行智能编辑
  • 多种宽高比支持: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
  • 灵活的图片输入: 支持 URL、Base64 Data URI、本地文件路径
  • 支持格式: png, jpg, jpeg, gif, webp

安装

使用 npx(推荐)

npx comet-nanobanana-zijie

全局安装

npm install -g comet-nanobanana-zijie

在 Claude Desktop 中使用

在 Claude Desktop 配置文件中添加 MCP 服务器配置:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "comet-nanobanana-zijie": {
      "command": "npx",
      "args": ["comet-nanobanana-zijie"],
      "env": {
        "COMET_API_KEY": "sk-your-api-key-here"
      }
    }
  }
}

重要: 请将 sk-your-api-key-here 替换为你的 Comet API 密钥。

本地开发配置

{
  "mcpServers": {
    "comet-nanobanana-zijie": {
      "command": "node",
      "args": ["/path/to/comet-nanobanana-zijie/src/index.js"],
      "env": {
        "COMET_API_KEY": "sk-your-api-key-here"
      }
    }
  }
}

工具说明

1. text_to_image - 文生图

根据文本描述生成图片。

参数:

  • prompt (必填, string): 图片描述文本
    • 建议包含风格关键词(如 photorealistic, cyberpunk, watercolor
    • 描述主体、背景、光照、细节等
  • aspectRatio (可选, string): 图片宽高比
    • 可选值: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
    • 不设置时为默认比例
    • 所有分辨率消耗 1290 tokens

示例:

{
  "prompt": "A cute white rabbit sitting in a garden with flowers, highly detailed, photorealistic, soft lighting",
  "aspectRatio": "16:9"
}

返回:

{
  "success": true,
  "image": {
    "base64": "iVBORw0KGgo...",
    "mimeType": "image/png",
    "size": 123456
  },
  "metadata": {
    "prompt": "...",
    "aspectRatio": "16:9",
    "model": "gemini-3-pro-image"
  }
}

2. edit_image - 图片编辑

基于输入图片和文本提示生成编辑后的图片。

参数:

  • prompt (必填, string): 编辑指令文本
    • 描述如何修改图片,如风格转换、颜色调整、对象替换等
  • inputImage (必填, string): 输入图片,支持三种格式:
    • HTTP(S) URL: https://example.com/image.jpg
    • Data URI: data:image/png;base64,iVBORw0KGgo...
    • 本地文件路径: /path/to/image.pngC:\path\to\image.jpg
    • 支持格式: png, jpg, jpeg, gif, webp
  • aspectRatio (可选, string): 输出图片宽高比
    • 可选值同上
    • 不设置时自动适配输入图片比例

示例 1 - 黑白转换:

{
  "prompt": "Convert this image to black and white, maintain all details",
  "inputImage": "https://example.com/image.jpg"
}

示例 2 - 风格转换:

{
  "prompt": "Convert to watercolor painting style",
  "inputImage": "/Users/username/pictures/photo.png",
  "aspectRatio": "1:1"
}

示例 3 - 使用 Base64:

{
  "prompt": "Make the background blue sky",
  "inputImage": "data:image/png;base64,iVBORw0KGgo..."
}

返回:

{
  "success": true,
  "image": {
    "base64": "iVBORw0KGgo...",
    "mimeType": "image/png",
    "size": 234567
  },
  "metadata": {
    "prompt": "...",
    "aspectRatio": "auto",
    "inputImageType": "image/jpeg",
    "model": "gemini-3-pro-image"
  }
}

API 技术细节

  • Base URL: https://api.cometapi.com
  • Model: gemini-3-pro-image
  • Authorization: 直接使用 API Key(不需要 Bearer 前缀)
  • Token 消耗: 所有分辨率消耗 1290 tokens

参考文档

常见问题

Q: 支持哪些图片格式? A: 输入支持 png, jpg, jpeg, gif, webp;输出通常为 png。

Q: 图片编辑时 Base64 需要带前缀吗? A: Data URI 格式需要完整前缀(data:image/png;base64,...),但如果你直接传纯 Base64,代码会自动处理。

Q: 默认宽高比是多少? A: 官方文档未明确说明,建议不设置时让 API 自动决定,或手动指定如 1:1

Q: 如何获取 API Key? A: 访问 Comet API 官网注册并获取密钥。

许可证

MIT

作者

zijie