Comfy MCP Server logo

Comfy MCP Server

by lalanikarim

This server uses the FastMCP framework to generate images based on prompts via a remote Comfy server. It allows users to submit prompts and retrieve generated images from a ComfyUI workflow.

View on GitHub

Last updated: N/A

What is Comfy MCP Server?

Comfy MCP Server is a server that leverages the FastMCP framework to generate images from prompts using a remote Comfy server. It acts as an intermediary, allowing users to submit prompts and receive generated images based on a pre-defined ComfyUI workflow.

How to use Comfy MCP Server?

  1. Install the required packages using uvx mcp[cli]. 2. Configure environment variables such as COMFY_URL, COMFY_WORKFLOW_JSON_FILE, PROMPT_NODE_ID, OUTPUT_NODE_ID, and OUTPUT_MODE. 3. Optionally, configure Ollama integration by setting OLLAMA_API_BASE and PROMPT_LLM. 4. Launch the server using uvx comfy-mcp-server. 5. Interact with the server to generate images by sending prompts.

Key features of Comfy MCP Server

  • Remote ComfyUI interaction

  • FastMCP framework integration

  • Prompt-based image generation

  • Configurable workflow

  • Ollama integration for prompt generation

Use cases of Comfy MCP Server

  • Automated image generation pipelines

  • Generating images from text prompts

  • Integrating ComfyUI workflows into other applications

  • Creating images using LLM-generated prompts

  • Batch image generation

FAQ from Comfy MCP Server

What is FastMCP?

FastMCP is a framework used for setting up the server.

What is ComfyUI?

ComfyUI is a node-based visual programming environment for creating and executing complex workflows, often used for image generation.

How do I find the PROMPT_NODE_ID and OUTPUT_NODE_ID?

These IDs can be found within the ComfyUI workflow export JSON file. Inspect the JSON structure to identify the nodes corresponding to the text prompt and the final image output.

What is Ollama used for?

Ollama is used for generating image generation prompts from a given topic, enhancing the creative possibilities of the server.

What output modes are supported?

The server supports url and file output modes, allowing you to retrieve the generated image either as a URL or a file.