ComfyUI MCP Server
LM Studio → ComfyUI 이미지 생성기
ComfyUI MCP Server
ComfyUI 이미지 및 3D 생성을 단일 도구로 노출하는 MCP(Model Context Protocol) 서버입니다.
프롬프트를 자동 분류하여(사람, 건물, 일반 또는 3D) 올바른 워크플로우를 자동으로 선택합니다.
AI 어시스턴트에 완벽합니다 – MCP로 연결하면 LLM이 자산을 직접 생성할 수 있습니다.
기능
🧠 스마트 프롬프트 분류 – 사람, 건물 또는 3D 모델을 원하는지 감지합니다.
🖼️ 2D 생성 – 자신만의 ComfyUI 워크플로우(
general,people,buildings)를 사용합니다.🤖 3D 생성(Hunyuan3D) – 먼저 참조 이미지를 생성한 다음 3D 워크플로우를 실행합니다.
🔌 MCP 도구 – 모든 MCP 클라이언트에
generate_asset_tool(prompt, workflow_type, size)를 노출합니다.📂 워크플로우 폴더 –
.json워크플로우를./workflows/에 넣으세요.
Related MCP server: comfyui-mcp
설정
1. 사전 요구 사항
Python 3.10+
ComfyUI가 API가 활성화된 상태로 로컬에서 실행 중이어야 합니다(기본값
http://127.0.0.1:8188).ComfyUI 워크플로우가
.json파일로 내보내져 있어야 합니다.
2. 종속성 설치
pip install -r requirements.txt
3. 워크플로우 배치
ComfyUI 워크플로우 JSON 파일을 workflows/ 폴더에 넣으세요. 파일 이름은 정확히 일치해야 합니다:
general.json
people.json
buildings.json
3d_simple.json
⚠️ 3D에 중요한 사항: 3d_simple.json에는 ID가 "26"인 LoadImage 노드가 반드시 포함되어야 합니다. 코드는 업로드된 참조 이미지를 workflow["26"]["inputs"]["image"]에 주입합니다.
구성(선택 사항) ComfyUI URL을 재정의하려면 .env 파일을 만드세요:
text COMFY_URL=http://127.0.0.1:8188 설정하지 않으면 기본값은 http://127.0.0.1:8188입니다.
사용법
MCP 서버 실행
bash python mcp_server.py
서버가 시작되고 generate_asset_tool 도구를 등록합니다.
도구 매개변수
prompt (str, required): 생성할 내용에 대한 설명입니다.
workflow_type (str, optional): "people", "buildings", "general" 또는 "3d_simple". 생략하면 자동 감지됩니다.
size (str, optional): "512x512", "512x768" 또는 "768x512". 생략하면 자동 선택됩니다.
MCP 클라이언트 예시
json { "tool": "generate_asset_tool", "arguments": { "prompt": "a futuristic cyberpunk girl with neon hair" } } → 사람을 자동 감지하고, people.json을 512x768 크기로 사용하여 이미지 URL을 반환합니다.
json { "tool": "generate_asset_tool", "arguments": { "prompt": "turn this into a 3d model: a wooden chair", "workflow_type": "3d_simple" } } → (general을 통해) 참조 이미지를 생성한 다음, 3d_simple.json을 실행합니다. 두 URL을 모두 반환합니다.
작동 방식
분류 – 프롬프트에서 키워드(girl, building, 3d 등)를 스캔하여 올바른 워크플로우와 해상도를 선택합니다.
프롬프트 주입 – CLIPTextEncode 노드를 찾아 포지티브 프롬프트(사용자 프롬프트)와 네거티브 프롬프트(내장 프리셋)를 채웁니다.
랜덤 시딩 – 매번 고유한 결과를 얻기 위해 KSampler 시드를 무작위화합니다.
대기열 및 폴링 – /prompt를 통해 ComfyUI로 워크플로우를 보내고, 결과가 준비될 때까지 /history를 폴링합니다.
출력 – 생성된 파일을 보거나 다운로드할 수 있는 전체 URL을 반환합니다.
오류 처리
ComfyUI가 실행 중이 아니면 – ERROR를 반환합니다.
실패 시 – 자동으로 최대 2회 재시도합니다.
상세 로그가 콘솔에 출력됩니다.
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
MCP server for Wan AI video generation
MCP server for Flux AI image generation
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server that provides image generation, captioning, and tagging via ComfyUI API, configurable for agent tools.43MIT
- FlicenseNot gradedqualityDmaintenanceMCP server exposing a local (or LAN) ComfyUI instance's HTTP API as tools, so an LLM client can queue generations, inspect the queue/history, upload reference images, browse installed models/nodes, and pull back generated images.-
- AlicenseNot gradedqualityDmaintenanceMCP server that enables AI agents to control a local ComfyUI instance for image generation, allowing workflow understanding, parameter modification, execution, and model discovery.11 npm3Apache 2.0
- AlicenseNot gradedqualityBmaintenanceA lightweight MCP server that bridges AI agents with a local ComfyUI instance, enabling them to generate and iteratively refine images, audio, and video through conversational tool calls.10 npm1MIT