FLUX Image Generator MCP Server

Integrations

  • Uses .ENV files for configuration, allowing users to securely store their Black Forest Lab API key.

  • Provides tools for generating images using Black Forest Lab's FLUX model with features including text-to-image generation, customizable dimensions, prompt upsampling, and batch image generation.

  • Runs as a Node.js application, requiring v18.0.0 or higher for operation as a prerequisite for the server.

FLUXイメージジェネレーターMCPサーバー

Black Forest LabのFLUXモデルを用いて画像を生成するためのMCP(Model Context Protocol)サーバー。最新のMCP SDK(v1.7.0)を使用しています。

特徴

  • テキストプロンプトに基づいて画像を生成する
  • 画像のサイズ、プロンプトのアップサンプリング、および安全設定をカスタマイズします
  • 生成された画像をローカルに保存する
  • 複数のプロンプトからのバッチ画像生成

前提条件

インストール

ソースから

  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" } ] }

ライセンス

マサチューセッツ工科大学

You must be authenticated.

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

Black Forest Lab の FLUX モデルを使用してテキスト プロンプトに基づいて画像を生成する MCP サーバー。カスタマイズされた画像サイズ、プロンプトのアップサンプリング、安全性の設定、バッチ生成が可能です。

  1. Features
    1. Prerequisites
      1. Installation
        1. From Source
        2. Using npm
      2. Usage
        1. Starting the MCP Server
        2. Integrating with MCP Clients
      3. Available Tools
        1. generateImage
        2. quickImage
        3. batchGenerateImages
      4. Output Format
        1. License
          ID: pvczsau570