图像生成服务

一个基于Model Context Protocol (MCP)的服务器,通过Together AI实现高质量图像生成,提供标准化的参数接口。

  • by sarthakkimtani
  • Python
  • 本地部署
  • 18 星标
  • 更新于
在 GitHub 查看 sarthakkimtani/mcp-image-gen

使用说明

图像生成MCP服务器

一种模型上下文协议(MCP)服务器,可通过Together AI无缝生成高质量图像。该服务器提供了一个标准化的接口来指定图像生成参数。

特性

  • Flux.1 Schnell模型支持的高质量图像生成
  • 支持自定义尺寸(宽度和高度)
  • 为即时验证和API问题清除错误处理
  • 与MCP兼容客户端轻松集成

安装

克劳德桌面

  • 在MacOS上: ~/Library/Application\ Support/Claude/claude_desktop_config.json
  • 在Windows上: %APPDATA%/Claude/claude_desktop_config.json
Development/Unpublished Servers Configuration
{
  "mcpServers": {
    "image-gen": {
      "command": "uv",
      "args": ["--directory", "/ABSOLUTE/PATH/TO/image-gen/", "run", "image-gen"],
      "env": {
        "TOGETHER_AI_API_KEY": "<API KEY>"
      }
    }
  }
}

可用工具

服务器实现了一个工具:

generate_image

根据给定的文本提示和可选尺寸生成图像。

输入架构:

{
  "prompt": {
    "type": "string",
    "description": "A descriptive prompt for generating the image (e.g., 'a futuristic cityscape at sunset')"
  },
  "width": {
    "type": "integer",
    "description": "Width of the generated image in pixels (optional)"
  },
  "height": {
    "type": "integer",
    "description": "Height of the generated image in pixels (optional)"
  },
  "model": {
    "type": "string",
    "description": "The exact model name as it appears in Together AI. If incorrect, it will fallback to the default model (black-forest-labs/FLUX.1-schnell)."
  }
}

先决条件

  • Python 3.12或更高版本
  • httpx
  • 主控程序

贡献

欢迎投稿!请按照以下步骤进行贡献:

  1. 分叉存储库
  2. 创建新分支(feature/my-new-feature)
  3. 提交您的更改
  4. 把树枝推到叉子上
  5. 打开拉取请求

对于重大更改,请先打开一个问题来讨论您提出的更改。

许可证

该项目根据MIT许可证获得许可。有关详细信息,请参阅LICENSE文件。