Skip to content

no87921/cloudflare-flux-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Cloudflare Flux MCP Server

MCP server for Cloudflare Workers AI image generation. Supports multiple models including FLUX, SDXL, and Dreamshaper.

Features

  • Multiple Models: flux-1-schnell, flux-2-dev, sdxl, dreamshaper
  • Multi-Reference Support: flux-2-dev supports up to 4 reference images
  • Free Tier: Cloudflare Workers AI offers 10,000 free requests per day
  • Text Generation: flux models support English text in images

Models

Model Description Text Support Quality
flux-1-schnell Fast generation ✅ English OK ⭐⭐⭐⭐
flux-2-dev High quality, multi-reference ✅ English OK ⭐⭐⭐⭐⭐
sdxl Stability AI classic ⭐⭐⭐
dreamshaper Realistic, good for portraits ⭐⭐⭐

Installation

npm install

Configuration

Add to your OpenClaw openclaw.json:

{
  "plugins": {
    "entries": {
      "mcporter": {
        "config": {
          "servers": {
            "cloudflare-flux": {
              "command": "node",
              "args": ["/path/to/cloudflare-flux/index.js"],
              "env": {
                "CLOUDFLARE_ACCOUNT_ID": "your-account-id",
                "CLOUDFLARE_API_TOKEN": "your-api-token"
              }
            }
          }
        }
      }
    }
  }
}

Usage

Basic Generation

mcporter call cloudflare-flux.generate_image \
  prompt="a cute cat wearing a hat" \
  model="flux-1-schnell"

With Reference Image (flux-2-dev only)

mcporter call cloudflare-flux.generate_image \
  prompt="add a sailboat to the sea in image 0" \
  model="flux-2-dev" \
  input_image_0="/path/to/your/image.jpg"

Parameters

Parameter Type Required Description
prompt string Image description (English works better, max 2048 chars)
model string Model selection (default: flux-1-schnell)
steps integer Diffusion steps (default: 4, max: 8, flux only)
width integer Image width (flux-2-dev only, default: 1024)
height integer Image height (flux-2-dev only, default: 1024)
output_path string Save path (default: /tmp/generated-image.png)
input_image_0 string Reference image 0 path (flux-2-dev only)
input_image_1 string Reference image 1 path (flux-2-dev only)
input_image_2 string Reference image 2 path (flux-2-dev only)
input_image_3 string Reference image 3 path (flux-2-dev only)

Cloudflare Setup

  1. Go to Cloudflare Dashboard
  2. Get your Account ID from the right sidebar
  3. Create an API Token with Workers AI permissions
  4. Set environment variables or pass in config

License

MIT

About

free Image generation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors