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

doubao-i2i-generator-mcp

v1.0.0

Published

MCP Server for generating images using Doubao Seedream 3.0 i2i (image-to-image) model

Readme

豆包Seedream 3.0 i2i图生图 MCP 插件

这是一个基于Model Context Protocol (MCP)的豆包Seedream 3.0 i2i图生图插件,可以让AI助手直接调用豆包的图像到图像生成能力。

功能特性

  • 🎨 图像到图像生成: 根据文字提示和输入图片生成新图片
  • 🔧 MCP集成: 完全兼容MCP协议,可与支持MCP的AI助手集成
  • 🖼️ 图片输入: 支持URL图片作为输入源
  • 📱 自适应尺寸: 支持adaptive尺寸,自动适配输入图片比例
  • 🎯 精确控制: 支持随机种子、引导强度等参数调节
  • 💧 水印控制: 可选择是否添加水印

安装和配置

1. 安装依赖

npm install

2. 设置API密钥

设置环境变量 ARK_API_KEY

Windows (PowerShell):

$env:ARK_API_KEY="your_api_key_here"

Windows (CMD):

set ARK_API_KEY=your_api_key_here

Linux/Mac:

export ARK_API_KEY="your_api_key_here"

3. 配置模型ID

默认使用i2i模型:doubao-seededit-3-0-i2i-250628

使用方法

启动MCP服务器

npm start

可用的MCP工具

1. i2i图像生成 (generate_i2i_image)

{
  "name": "generate_i2i_image",
  "arguments": {
    "prompt": "改成爱心形状的泡泡",
    "image": "https://example.com/input-image.jpg",
    "size": "adaptive",
    "seed": 21,
    "guidance_scale": 5.5,
    "watermark": true
  }
}

参数说明:

  • prompt (必需): 文字提示词,描述想要生成的图片效果
  • image (必需): 输入图片的URL地址
  • model: 模型ID,默认: doubao-seededit-3-0-i2i-250628
  • size: 图像尺寸,默认: adaptive (自适应)
  • seed: 随机种子,用于控制生成结果的一致性,默认: 21
  • guidance_scale: 引导强度,控制生成图片与提示词的匹配程度,默认: 5.5
  • watermark: 是否添加水印,默认: true
  • response_format: 输出格式,可选值: url, b64_json,默认: url

测试

使用Node.js脚本测试

运行提供的测试脚本:

node test_i2i.js

使用MCP客户端测试

如果你有支持MCP的客户端,可以直接调用工具:

# 示例:生成i2i图像
curl -X POST "http://localhost:3000/tools/generate_i2i_image" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "改成爱心形状的泡泡",
    "image": "https://example.com/input-image.jpg",
    "size": "adaptive"
  }'

配置选项

环境变量

  • ARK_API_KEY: 豆包API密钥 (必需)
  • ARK_BASE_URL: API基础URL,默认: https://ark.cn-beijing.volces.com/api/v3

默认参数

  • 模型ID: doubao-seededit-3-0-i2i-250628
  • 尺寸: adaptive
  • 引导强度: 5.5
  • 随机种子: 21
  • 水印: true

API响应格式

成功响应示例:

{
    "model": "doubao-seededit-3-0-i2i-250628",    
    "created": 1752479401,                       
    "data": [
        {
            "url": "https://ark-content-generation-v2-cn-beijing.tos-cn-beijing.volces.com/doubao-seededit-3-0-i2i/******"
        }
    ],
    "usage": {
        "generated_images": 1,                   
        "output_tokens": 3772,                    
        "total_tokens": 3772                      
    }
}

错误处理

插件包含完善的错误处理:

  • API密钥验证
  • 网络请求超时
  • 参数验证
  • 错误信息返回

注意事项

  1. API密钥安全: 请妥善保管你的API密钥,不要提交到代码仓库
  2. 请求限制: 注意豆包API的请求频率限制
  3. 图片URL: 确保输入图片URL可以正常访问
  4. 网络环境: 确保能够访问豆包API服务器

故障排除

常见问题

  1. API密钥错误

    • 检查环境变量是否正确设置
    • 确认API密钥是否有效
  2. 网络连接问题

    • 检查网络连接
    • 确认防火墙设置
  3. 图片URL问题

    • 检查输入图片URL是否可访问
    • 确认图片格式是否支持

日志查看

MCP服务器会在控制台输出错误信息,包括:

  • API请求状态
  • 错误详情
  • 调试信息

许可证

MIT License

贡献

欢迎提交Issue和Pull Request来改进这个插件!

更新日志

v1.0.0

  • 添加豆包Seedream 3.0 i2i图生图功能
  • 集成MCP协议支持
  • 支持图片URL输入
  • 完善错误处理和配置管理