Together AI图像生成MCP
通过MCP服务器启用使用Together AI模型生成图像的功能,支持可自定义的参数,例如模型选择、图像尺寸和输出目录。
可用工具 (1 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
generate_image 8 个参数 需填 1 项
Generate an image using Together AI
必填参数:prompt
服务介绍
Together AI 图像服务器
一个使用 Together AI 的图像生成模型来生成图像的 MCP 服务器。
设置
- 安装依赖项:
npm install
- 构建服务器:
npm run build
配置
1. Together AI API 密钥
服务器需要一个 Together AI API 密钥。你可以从 Together AI 平台 获取。
2. Cline 配置
将服务器添加到你的 Cline MCP 设置文件中:
对于 macOS/Linux: ~/Library/Application Support/Windsurf/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
"mcpServers": {
"togetherai-image": {
"command": "node",
"args": ["/path/to/togetherai-image-server/build/index.js"],
"env": {
"TOGETHER_API_KEY": "your-api-key-here"
},
"disabled": false,
"autoApprove": []
}
}
}
在 Cline 中使用
该服务器提供了一个带有以下参数的 generate_image 工具:
{
prompt: string; // Required: Text description of the image to generate
model?: string; // Optional: Model to use (default: 'black-forest-labs/FLUX.1.1-pro')
width?: number; // Optional: Image width in pixels (default: 1024)
height?: number; // Optional: Image height in pixels (default: 768)
steps?: number; // Optional: Number of inference steps (default: 28)
n?: number; // Optional: Number of images to generate (default: 1)
outputDir?: string; // Optional: Directory where images will be saved (default: './output')
}
示例用法
你可以在 Cline 中这样使用服务器:
Generate an image of a cat and save it to my desktop:
<use_mcp_tool>
<server_name>togeherai-image</server_name>
<tool_name>generate_image</tool_name>
<arguments>
{
"prompt": "A cute cat sitting on a windowsill",
"outputDir": "/Users/username/Desktop/generated-images"
}
</arguments>
</use_mcp_tool>
输出
工具返回一个 JSON 响应,包含:
filepath: 保存图像的完整路径filename: 保存图像文件的名称dimensions: 图像的原始和最终尺寸
特性
- 支持 Together AI 的最新 FLUX.1.1-pro 模型
- 如果图像尺寸小于 256 像素,则自动调整大小
- 调整大小时保持宽高比
- 高质量 JPEG 输出(90% 质量)
- 递归创建输出目录
- 返回包括图像尺寸在内的详细元数据