Skip to main content
Glama

FLUX Image Generator MCP Server

by frankdeno

FLUX 图像生成器 MCP 服务器

一个 MCP(模型上下文协议)服务器,用于使用 Black Forest Lab 的 FLUX 模型生成图像。使用最新的 MCP SDK (v1.7.0)。

特征

  • 根据文本提示生成图像
  • 自定义图像尺寸、快速上采样和安全设置
  • 将生成的图像保存在本地
  • 从多个提示批量生成图像

先决条件

  • Node.js(v18.0.0 或更高版本)
  • Black Forest Lab API 密钥(在https://api.bfl.ml获取)

安装

来自源

  1. 克隆此存储库
  2. 安装依赖项:
npm install
  1. 根据.env.example创建一个.env文件并添加您的 Black Forest Lab API 密钥:
BFL_API_KEY=your_api_key_here
  1. 构建项目:
npm run build

使用 npm

npm install -g @modelcontextprotocol/server-flux-image-generator

用法

启动 MCP 服务器

使用以下命令启动服务器:

npm start

对于使用自动重新编译的开发:

npm run watch

与 MCP 客户端集成

要将此服务器与 MCP 客户端(如 Claude)一起使用,请将以下内容添加到客户端的配置中:

{ "mcpServers": { "flux-image-generator": { "command": "mcp-server-flux-image-generator", "env": { "BFL_API_KEY": "your_api_key_here" } } } }

可用工具

生成图像

根据具有可自定义设置的文本提示生成图像。

参数:

  • prompt (字符串,必需):要生成的图像的文本描述
  • width (数字,可选,默认值:1024):图像的宽度(以像素为单位)
  • height (数字,可选,默认值:1024):图像的高度(以像素为单位)
  • promptUpsampling (布尔值,可选,默认值:false):通过对提示进行上采样来增强细节
  • seed (数字,可选):用于可重复结果的随机种子
  • safetyTolerance (数字,可选,默认值:3):内容审核容忍度(1-5)

例子:

{ "prompt": "A serene lake at sunset with mountains in the background", "width": 1024, "height": 768, "promptUpsampling": true, "seed": 12345, "safetyTolerance": 3 }

快速图像

使用默认设置快速生成图像的简化工具。

参数:

  • prompt (字符串,必需):要生成的图像的文本描述

例子:

{ "prompt": "A futuristic cityscape with flying cars" }

批量生成图像

根据提示列表生成多个图像。

参数:

  • prompts (字符串数组,必需):文本提示列表(最多 10 个)
  • width (数字,可选,默认值:1024):图像的宽度
  • height (数字,可选,默认值:1024):图像的高度

例子:

{ "prompts": [ "A serene lake at sunset", "A futuristic cityscape", "A magical forest with glowing plants" ], "width": 1024, "height": 768 }

输出格式

所有工具都以这种格式返回响应:

{ "image_url": "https://storage.example.com/generated_image.jpg", "local_path": "/path/to/output/flux_1234567890.png" }

对于错误:

{ "error": true, "message": "Error description" }

批处理工具返回:

{ "total": 3, "successful": 2, "failed": 1, "results": [ { "prompt": "A serene lake at sunset", "success": true, "image_url": "https://storage.example.com/image1.jpg", "local_path": "/path/to/output/flux_batch_1234567890_0.png" }, { "prompt": "A futuristic cityscape", "success": true, "image_url": "https://storage.example.com/image2.jpg", "local_path": "/path/to/output/flux_batch_1234567890_1.png" }, { "prompt": "Prohibited content", "success": false, "error": "Content policy violation" } ] }

执照

麻省理工学院

Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

MCP 服务器使用 Black Forest Lab 的 FLUX 模型根据文本提示生成图像,允许自定义图像尺寸、提示上采样、安全设置和批量生成。

  1. 特征
    1. 先决条件
      1. 安装
        1. 来自源
        2. 使用 npm
      2. 用法
        1. 启动 MCP 服务器
        2. 与 MCP 客户端集成
      3. 可用工具
        1. 生成图像
        2. 快速图像
        3. 批量生成图像
      4. 输出格式
        1. 执照

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A MCP server that enables Claude and other MCP-compatible assistants to generate images from text prompts using Together AI's image generation models.
            Last updated -
            1
            4
            TypeScript
            MIT License
            • Apple
            • Linux
          • A
            security
            F
            license
            A
            quality
            A TypeScript-based MCP server that generates images using OpenAI's dall-e-3 model based on text prompts and saves them to a specified directory.
            Last updated -
            1
            10
            JavaScript
            • Apple
          • A
            security
            A
            license
            A
            quality
            An MCP server that enables AI assistants to generate images using Black Forest Labs' Flux model via Cloudflare Workers.
            Last updated -
            1
            JavaScript
            MIT License
          • -
            security
            F
            license
            -
            quality
            An MCP image generation server based on the Flux Schnell model that provides API access for generating images from text prompts with customizable dimensions and seeds.
            Last updated -
            1
            Python
            • Linux
            • Apple

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/frankdeno/flux-image-generator-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server