PolarHub
  • Agents
  • MCP Servers
  • Skills
  • PolarBear
PolarHub © 2026
MCP Serversimage-and-video-processingcomfyui-mcp
返回「image-and-video-processing」

comfyui-mcp

modelscope·@PurlieuStudios/comfyui-mcp

image-and-video-processing0下载LocalModelScope

简介

暂无描述。

MCP Server 详情

来自 ModelScope 索引

ComfyUI MCP Server

AI-powered image generation for game development via ComfyUI and the Model Context Protocol

CI Python 3.10+ License: MIT Code style: ruff Type checked: mypy

Overview

ComfyUI MCP Server is a Model Context Protocol (MCP) server that bridges ComfyUI's powerful workflow-based AI image generation with modern development workflows. Originally designed for Godot game development, it can be used with any MCP-compatible client to generate game assets, concept art, and visual content dynamically.

Key Features

  • MCP Integration: Expose ComfyUI workflows as standardized MCP tools
  • Python API Client: Full-featured async ComfyUI API client with type safety
  • Workflow Templates: Pre-built templates for common game assets (characters, items, environments)
  • Async Operations: Non-blocking generation with real-time progress updates via WebSockets
  • Flexible Configuration: TOML files, environment variables, or Python code
  • Type Safe: Full type hints with strict mypy validation
  • Well Tested: Comprehensive test coverage with pytest
  • Production Ready: Retry logic, error handling, and logging built-in

Use Cases

  • Character Generation: NPC portraits, character sprites, concept art
  • Item Icons: Unique item icons from text descriptions
  • Environment Art: Background textures, tileable patterns, landscapes
  • Dynamic Content: Procedural asset generation during gameplay
  • Concept Art: Rapid visual prototyping and iteration
  • Batch Processing: Generate multiple asset variations efficiently

Table of Contents

  • Quick Start
  • Installation
  • Configuration
  • Usage
    • MCP Server
    • Python API Client
  • Workflow Templates
  • Documentation
  • Examples
  • Development
  • Troubleshooting
  • Contributing
  • License

Quick Start

Prerequisites

  1. Python 3.10 or higher

    python --version  # Should be 3.10+
    
  2. ComfyUI installed and running

    • Download: ComfyUI GitHub
    • Default URL: http://localhost:8188
    • Verify: Open http://localhost:8188 in your browser
  3. Stable Diffusion models

    • Download models and place in ComfyUI's models/checkpoints/ directory
    • Recommended: Stable Diffusion 1.5 or 2.1 for game assets

Installation

# Clone the repository
git clone https://github.com/purlieu-studios/comfyui-mcp.git
cd comfyui-mcp

# Install the package
pip install -e .

# For development (includes testing and linting tools)
pip install -e ".[dev]"

# Verify installation
python -c "from comfyui_mcp import ComfyUIClient; print('Installation successful!')"

Basic Configuration

Option 1: Environment Variables (Recommended for getting started)

# Required
export COMFYUI_URL="http://localhost:8188"

# Optional
export COMFYUI_TIMEOUT="120.0"
export COMFYUI_OUTPUT_DIR="./generated_images"

Option 2: TOML Configuration File

Create comfyui.toml in your project root:

[comfyui]
url = "http://localhost:8188"
timeout = 120.0
output_dir = "./generated_images"

See docs/CONFIGURATION.md for comprehensive configuration options.

Your First Generation

Using the Python API

import asyncio
from comfyui_mcp import ComfyUIClient, ComfyUIConfig, WorkflowPrompt

async def generate_image():
    # Configure the client
    config = ComfyUIConfig(url="http://localhost:8188")

    async with ComfyUIClient(config) as client:
        # Check ComfyUI server health
        if not await client.health_check():
            print("ComfyUI server is not responding!")
            return

        # Create a simple workflow
        workflow = WorkflowPrompt(
            prompt={
                "3": {
                    "class_type": "KSampler",
                    "inputs": {
                        "seed": 42,
                        "steps": 20,
                        "cfg": 7.0,
                        "sampler_name": "euler",
                        "scheduler": "normal",
                        "denoise": 1.0
                    }
                }
            }
        )

        # Submit and wait for completion
        prompt_id = await client.submit_workflow(workflow)
        print(f"Workflow submitted: {prompt_id}")

        result = await client.wait_for_completion(
            prompt_id=prompt_id,
            poll_interval=1.0,
            timeout=300.0
        )

        print(f"Generation complete! Result: {result}")

# Run the async function
asyncio.run(generate_image())

Using the MCP Server

1. Configure MCP Server

Add to your .mcp.json:

{
  "mcpServers": {
    "comfyui-mcp": {
      "command": "python",
      "args": ["-m", "comfyui_mcp.server"],
      "env": {
        "COMFYUI_URL": "http://localhost:8188",
        "COMFYUI_OUTPUT_DIR": "./generated_images"
      }
    }
  }
}

More Configuration Examples:

Complete .mcp.json configuration examples are available in examples/mcp/:

ExampleDescriptionUse Case
[basic.mcp.json](…

相关 MCP Servers(来自「image-and-video-processing」)

魔法组件协议

ModelContextProtocol服务器适用于Magic UI,它通过提供诸如跑马灯、动画、特效和互动背景等组件的代码,使AI助手能够轻松为Web应用程序实现UI组件。

@magicuidesign/mcp

网页开发MCP

一个提供网页开发工具的MCP服务器,例如屏幕捕捉功能,可以让AI代理获取并处理用户屏幕的截图。

@ZukAi-MCP/webdev-mcp

智能组件生成器

一个由人工智能驱动的工具,可以从自然语言描述生成现代UI组件,并与流行的IDE集成,以简化UI开发工作流程。

@21st-dev/magic-mcp

Blender

通过模型上下文协议(MCP)将Blender连接到Claude AI,使Claude能够直接与Blender交互并对其进行控制,从而实现AI辅助的3D建模、场景操作和渲染。

@ahujasid/blender-mcp

Dify组件生成器

集成了Dify AI API,为Ant Design组件提供代码生成服务,支持文本和图像输入,并具备流式处理能力。

@AI-FE/dify-mcp-server

Excalidraw MCP绘图管理器

一种模型上下文协议服务器,提供创建、管理和导出Excalidraw绘图的API功能,支持SVG、PNG和JSON等多种格式。

@i-tozer/excalidraw-mcp

自动安装

点击按钮会唤起 PolarBear 客户端,并把当前 MCP Server 的 Markdown 详情文档地址传给客户端。

/api/mcps/purlieustudios-comfyui-mcp/markdown
打开 PolarBear 安装查看 Markdown 文档

手动安装

在 PolarBear 或其他支持 MCP 的客户端中,新建 MCP Server,并参考下方来源或安装提示配置。

python --version # Should be 3.10+ ``` 2. **ComfyUI installed and running** - Download: [ComfyUI GitHub](https://github.com/comfyanonymous/ComfyUI) - Default URL: `http://localhost:8188` - Verify: Open `http://localhost:8188` in your browser 3. **Stable Diffusion models** - Download models and place in ComfyUI's `models/checkpoints/` directory - Recommended: Stable Diffusion 1.5 or 2.1 for game assets ### Installation ```bash # Clone the repository git clone https://github.com/purlieu-studios/comfyui-mcp.git cd comfyui-mcp # Install the package pip install -e . # For development (includes testing and linting tools) pip install -e ".[dev]" # Verify installation python -c "from comfyui_mcp import ComfyUIClient; print('Installation successful!')"

基本信息

分类
image-and-video-processing / games-and-gamification / developer-tools
运行方式
No
许可证
Unknown
详情文件
purlieustudios-comfyui-mcp.md