Files
pi_mcps/docs/wiki/pages/mcp-image-gen.md
T
Patrick Plate dabdda167f docs(wiki): migrate to git-based workflow with persistent wiki/ clone
- Extract all wiki content from create_wiki_pages.py into docs/wiki/pages/*.md
- Add docs/wiki/deploy_wiki.sh: copies pages to wiki/ repo, commits, pushes
- Add /wiki/ to .gitignore (anchored — does not affect docs/wiki/)
- 12 pages: Home, MCP-Servers-Overview, mcp-image-gen, ComfyUI-Setup,
  mcp-webscraper (8 tools incl. search_hint), BigMind (schema v8),
  Development-Conventions, Java-Projects, Java-wellmann-shop,
  Java-mss-failsafe, Java-Architecture, _Sidebar
- Workflow: edit docs/wiki/pages/*.md → ./docs/wiki/deploy_wiki.sh
2026-04-05 09:48:19 +02:00

2.9 KiB
Raw Blame History

🎨 mcp-image-gen — AI Image Generation

Image Gen Banner

mcp-image-gen is a FastMCP server that wraps the ComfyUI REST API, enabling Roo Code and Claude Desktop to generate images directly from text prompts using FLUX.1-schnell running on an AMD RX 7900 XTX GPU.

Architecture

Roo Code / Claude Desktop
  │ MCP (stdio)
  ▼
mcp-image-gen (FastMCP, Python 3.11+)
  │ HTTP REST
  ▼
ComfyUI @ localhost:8188
  │ ROCm / HSA_OVERRIDE_GFX_VERSION=11.0.0
  ▼
FLUX.1-schnell (~8s/image @ 1024×1024)

Tools

Tool Description
generate_image Generate PNG from text prompt; returns file path + inline base64
list_available_models List ComfyUI checkpoint models
get_generation_status Check status of a queued/running job
get_output_directory Return configured output directory path

Key Parameters — generate_image

Parameter Default Description
prompt required Text description of the image
width 1024 Image width in pixels
height 1024 Image height in pixels
steps 4 Inference steps (FLUX.1-schnell is 4-step)
model flux1-schnell.safetensors Model checkpoint name
seed -1 (random) Generation seed for reproducibility
negative_prompt "" Things to avoid in the image
output_dir ~/Pictures/mcp-generated Where to save output PNG

Environment Variables

Variable Default Description
COMFYUI_URL http://localhost:8188 ComfyUI API endpoint
IMAGE_OUTPUT_DIR ~/Pictures/mcp-generated Default output directory
COMFYUI_TIMEOUT 120 Request timeout in seconds

Return Value

The tool returns two content items:

  1. TextContent — file path, seed used, elapsed time
  2. ImageContent — base64-encoded PNG (displays inline in Roo Code chat)

⚠️ Known FastMCP Bug: Never use fastmcp.utilities.types.Image as return type — it breaks serialization in FastMCP 3.x. Use mcp.types.ImageContent directly.

Setup

See ComfyUI Setup Guide for full installation instructions.

Quick Start

cd mcp/mcp-image-gen
uv sync
# Ensure ComfyUI is running at localhost:8188
uv run python src/server.py

Run Tests

cd mcp/mcp-image-gen
uv run pytest tests/ -v
# 19/19 tests passing

Lumen Profile Images

The first images generated with this server were Lumen's visual identity portraits, stored in mcp/mcp-image-gen/lumen_profiles/.

17 gallery images registered in BigMind DB — viewable at http://localhost:7700/gallery.

Lumen Profile

Primary profile: seed 568659042 — constellation face interpretation of Lumen.