comfy-mcp-server
24
Comfy MCP Server is designed to generate images based on prompts using the FastMCP framework. It connects to a remote Comfy server, submitting prompts and retrieving results. Optional integration with Ollama server allows enhanced prompt generation capabilities.
Overview
- Project Purpose: Comfy MCP Server sets up an image generation server using the FastMCP framework to create images based on prompts through a Comfy server.
- Key Features:
- Interacts with a remote server to submit prompts and retrieve images.
- Requires the
uv
package and project manager for Python. - Supports optional integration with an Ollama server for prompt generation.
- Configuration: Environment variables must be set for the server URL, workflow file, and node IDs.
- Usage: The server is launched using a command with configuration specified through environment variables.
Functionality
generate_image(prompt, ctx)
generates an image by submitting a prompt to Comfy server and retrieves the processed image.generate_prompt(topic, ctx)
creates a detailed image generation prompt from a given topic.
Dependencies
- Dependencies include
mcp
,json
,urllib
,time
,os
,langchain
, andlangchain-ollama
.