I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

lalanikarim_comfy-mcp-server
Espejo dehttps: //github.com/lalanikarim/comfy-mcp-server
0
Github Watches
1
Github Forks
1
Github Stars
Comfy MCP Server
A server using FastMCP framework to generate images based on prompts via a remote Comfy server.
Overview
This script sets up a server using the FastMCP framework to generate images based on prompts using a specified workflow. It interacts with a remote Comfy server to submit prompts and retrieve generated images.
Prerequisites
- Python 3.x installed.
- Required packages:
mcp
,json
,urllib
,time
,os
. - Workflow file exported from Comfy UI. This code includes a sample
Flux-Dev-ComfyUI-Workflow.json
which is only used here as reference. You will need to export from your workflow and set the environment variables accordingly.
You can install the required packages using pip:
pip install "mcp[cli]"
Configuration
Set the following environment variables:
-
COMFY_URL
to point to your Comfy server URL. -
COMFY_WORKFLOW_JSON_FILE
to point to the absolute path of the API export json file for the comfyui workflow. -
PROMPT_NODE_ID
to the id of the text prompt node. -
OUTPUT_NODE_ID
to the id of the output node with the final image.
Example:
export COMFY_URL=http://your-comfy-server-url:port
export COMFY_WORKFLOW_JSON_FILE=/path/to/the/comfyui_workflow_export.json
export PROMPT_NODE_ID=6 # use the correct node id here
export OUTPUT_NODE_ID=9 # use the correct node id here
Usage
Run the script directly:
python comfy-mcp-server.py
The server will start and listen for requests to generate images based on the provided prompts.
Functionality
generate_image(prompt: str, ctx: Context) -> Image | str
This function generates an image using a specified prompt. It follows these steps:
- Checks if all the environment variable are set.
- Loads a prompt template from a JSON file.
- Submits the prompt to the Comfy server.
- Polls the server for the status of the prompt processing.
- Retrieves and returns the generated image once it's ready.
Dependencies
-
mcp
: For setting up the FastMCP server. -
json
: For handling JSON data. -
urllib
: For making HTTP requests. -
time
: For adding delays in polling. -
os
: For accessing environment variables.
License
This project is licensed under the MIT License - see the LICENSE file for details.
相关推荐
I find academic articles and books for research and literature reviews.
Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.
Confidential guide on numerology and astrology, based of GG33 Public information
Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.
Advanced software engineer GPT that excels through nailing the basics.
Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.
This GPT assists in finding a top-rated business CPA - local or virtual. We account for their qualifications, experience, testimonials and reviews. Business operators provide a short description of your business, services wanted, and city or state.
Converts Figma frames into front-end code for various mobile frameworks.
Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.
La aplicación AI de escritorio todo en uno y Docker con trapo incorporado, agentes de IA, creador de agentes sin código, compatibilidad de MCP y más.
Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx
Plataforma de automatización de flujo de trabajo de código justo con capacidades de IA nativas. Combine el edificio visual con código personalizado, auto-anfitrión o nube, más de 400 integraciones.
Espejo dehttps: //github.com/agentience/practices_mcp_server
🧑🚀 全世界最好的 llM 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Resumen de los mejores recursos del mundo.
Reviews

user_pzbukaGV
As a dedicated user of the lalanikarim_comfy-mcp-server by MCP-Mirror, I find this server solution incredibly efficient and user-friendly. The seamless integration and the ease of setup through the provided GitHub link (https://github.com/MCP-Mirror/lalanikarim_comfy-mcp-server) have significantly enhanced my workflow. The welcoming information and straightforward start URL make deployment quick and headache-free. Overall, it's an invaluable tool for MCP applications.