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

koishi-plugin-gemini-banana

v0.1.0

Published

[使用 gemini-banana 转换图片(ai爆改自lmarena)]多功能 AI 图像处理插件,支持手办化、Coser化、Minecraft化等多种风格转换,并提供自定义提示词和多图融合功能

Downloads

26

Readme

koishi-plugin-gemini-banana

npm Koishi

本插件爆改自 koishi-plugin-lmarena,感谢原作者 Lianues 的开源贡献。

🎯 一键将图片转换为手办、Coser等多种风格!

本插件主要使用 Google Gemini API 将用户提供的图片转换为各种预设或自定义的风格。同时,它也保留了对 LMArenaBridge 的支持,作为一个可选的、复杂的后备方案。

✨ 特性

  • Gemini 优先: 默认使用强大的 Gemini API,只需一个 API Key 即可开始使用。
  • 多种预设: 内置“手办化”、“coser化”、“MC化”等多种流行风格指令。
  • 高度可定制: 支持添加自定义指令,自由发挥创意。
  • 多图支持: 支持合并多张图片或为单个 prompt 提供多个图像输入。
  • 后备方案: 在 Gemini API 不可用时,可选择性地启用 LMArenaBridge 作为备用。

📦 安装

# 在你的 Koishi 项目根目录下执行
npm i koishi-plugin-gemini-banana

在 Koishi 插件市场搜索 gemini-banana 并安装。

⚙️ 配置

插件的配置分为两个主要部分:主方案 (Gemini)后备方案 (LMArenaBridge)

1. 主方案:使用 Gemini API (推荐)

这是最简单、最稳定的使用方式。

  1. 获取 API 密钥:

    • 访问 Google AI Studio
    • 点击 "Create API key" 创建一个新的 API 密钥并复制它。
  2. 在 Koishi 中配置:

    • enablePrimaryApi: 确保此项为 true (默认)。
    • primaryApiKey: 粘贴你刚刚获取的 Gemini API 密钥。
    • primaryModel: 使用的模型,默认为 gemini-2.5-flash-image-preview,即nano-banana(小香蕉)。

一个最小化的配置示例:

# 在你的 Koishi 配置文件中
plugins:
  gemini-banana:
    enablePrimaryApi: true
    primaryApiKey: "AIzaSyXXXXXXXXXXXXXXXXXXX" # 替换为你的 Gemini API Key

2. 后备方案:部署 LMArenaBridge (可选, 复杂)

⚠️ 警告: 此方案部署过程非常繁琐,且依赖于第三方网站(LMArena),可能随时失效。仅建议在无法使用 Gemini API 且具备动手能力的情况下尝试。

📝 使用方法

你可以通过 @机器人 或直接使用指令来调用。

预设指令

  • 手办化 [图片] - 将图片转换为手办风格。
  • coser化 [图片] - 将角色图片转换为真人 Cosplay 风格。
  • mc化 [图片] - 将图片转换为 Minecraft 风格。
  • ...以及你在配置中启用的其他指令。

示例: 发送 手办化 然后附带一张图片,或回复一张带有 手办化 指令的图片。

自定义指令

对于 custom 属性为 true 的指令(如默认的 合并图片, 修图),你可以提供自定义的提示词。

  • 合并图片 [图片1] [图片2] [可选的提示词]
  • 修图 [图片] [详细的修复要求]

如果未提供提示词,机器人会引导你输入。

📜 完整配置项参考

plugins:
  gemini-banana:
    # 基础配置
    basename: gemini-banana # 父级指令名
    defaultWaitTimeout: 50 # 等待用户发送图片的默认超时时间 (秒)

    # 主方案 (Gemini)
    enablePrimaryApi: true
    primaryApiKey: "YOUR_GEMINI_API_KEY"
    primaryModel: "gemini-1.5-flash-latest"
    primaryMaxRetries: 3
    primaryRetryInterval: 1000

    # 后备方案 (LMarenaBridge)
    enableFallback: false
    fallbackBaseUrl: "http://127.0.0.1:5102/v1/chat/completions"
    fallbackModel: "flux-1-kontext-pro"
    fallbackMaxRetries: 10
    fallbackRetryInterval: 5000

    # 指令配置 (可在此处修改或添加自定义指令)
    nested:
      commands:
        - name: 手办化
          prompt: Your task is to create a photorealistic...
          enabled: true
          custom: false
          maxImages: 1
          # ...
        - name: 自定义绘画
          prompt: "根据用户的要求绘画"
          enabled: true
          custom: true # 设为 true 以允许用户输入自己的提示词
          maxImages: 1
          
    # 调试设置
    loggerinfo: false # 开启后会在控制台输出详细的请求日志

📄 许可证

本项目使用 MIT License 开源。