ComfyUI MCP Server logo

ComfyUI MCP Server

by zuojianghua

ComfyUI MCP Server is a Model Context Protocol (MCP) server for ComfyUI. It provides image generation and prompt optimization services.

View on GitHub

Last updated: N/A

What is ComfyUI MCP Server?

ComfyUI MCP Server is an implementation of a Model Context Protocol (MCP) server specifically designed for ComfyUI. It acts as an intermediary, allowing users to generate images and optimize prompts using ComfyUI's text-to-image workflows.

How to use ComfyUI MCP Server?

To use the server, you need a running ComfyUI instance and the FastMCP library installed. Configure the server with the necessary parameters, including the ComfyUI URL and the path to the server script. The provided JSON configuration example demonstrates how to set up the server within an MCP environment.

Key features of ComfyUI MCP Server

  • Image Generation using ComfyUI workflows

  • Prompt Optimization for improved image results

  • Automatic image dimension adjustment (multiples of 8)

  • Random seed generation for diverse outputs

  • Returns both local file paths and online accessible URLs

Use cases of ComfyUI MCP Server

  • Generating images from text prompts

  • Improving the quality of generated images through prompt optimization

  • Automating image generation workflows with ComfyUI

  • Integrating ComfyUI image generation capabilities into other applications

  • Experimenting with different prompts and seeds to create diverse image outputs

FAQ from ComfyUI MCP Server

What is FastMCP?

FastMCP is a framework used to implement the Model Context Protocol.

What is the minimum Python version required?

Python 3.7 or higher is required.

Does this server require a ComfyUI instance?

Yes, a running ComfyUI instance is required for the server to function.

How do I configure the server?

The server is configured using a JSON configuration file, as shown in the example in the README.

What kind of prompts does the prompt optimization support?

The prompt optimization is designed for text prompts used in image generation workflows.