ComfyUI MCP 서버
1. 개요
ComfyUI를 MCP와 통합하기 위한 서버 구현.
⚠️ 중요: 이 서버에는 ComfyUI 서버가 실행 중이어야 합니다.
자신의 ComfyUI 서버를 호스팅해야 합니다.
또는 기존 ComfyUI 서버 주소에 액세스할 수 있습니다.
2. 디버깅
2.1 ComfyUI 디버깅
지엑스피1
2.2 MCP 디버깅
3. 설치 및 구성
3.1 ComfyUI 구성
src/.env
편집하여 ComfyUI 호스트와 포트를 설정합니다.COMFYUI_HOST=localhost COMFYUI_PORT=8188
3.2 사용자 정의 워크플로 추가
새로운 도구를 추가하려면 워크플로 JSON 파일을
workflows
디렉토리에 넣고 시스템에서 새 도구로 선언합니다.
4. 내장 도구
텍스트를 이미지로
생성된 이미지의 URL만 반환합니다.
실제 이미지를 얻으려면:
download_image
도구를 사용하거나브라우저에서 URL에 직접 접근하세요.
다운로드_이미지
이미지 URL을 사용하여 다른 도구(예:
text_to_image
)에서 생성된 이미지를 다운로드합니다.
파일과 함께 워크플로 실행
워크플로 JSON 파일의 경로를 제공하여 워크플로를 실행합니다.
# You should ask to agent like this. Run comfyui workflow with text_to_image.jsonCursorAI의 예시 이미지
json으로 워크플로 실행
워크플로 JSON 데이터를 직접 제공하여 워크플로를 실행합니다.
# You should ask to agent like this. Run comfyui workflow with this { "3": { "inputs": { "seed": 156680208700286, "steps": 20, ... (workflow JSON example) }
5. 실행 방법
5.1 UV 사용(권장)
예시
mcp.json
:{ "mcpServers": { "comfyui": { "command": "uv", "args": [ "--directory", "PATH/MCP/comfyui", "run", "--with", "mcp", "--with", "websocket-client", "--with", "python-dotenv", "mcp", "run", "src/server.py:mcp" ] } } }
5.2 Docker 사용하기
download_image
사용하여 로컬 폴더에 이미지를 다운로드하는 것은 Docker 컨테이너가 호스트 파일 시스템을 공유하지 않기 때문에 어려울 수 있습니다.Docker를 사용할 때 다음 사항을 고려하세요.
.env
에서RETURN_URL=false
설정하여 이미지 데이터를 바이트로 받습니다..env
에서COMFYUI_HOST
적절한 주소(예:host.docker.internal
또는 서버의 IP)로 설정합니다.참고: 이진 데이터를 사용하면 대용량 이미지 페이로드가 응답 한도를 초과할 수 있습니다.
5.2.1 Docker 이미지 빌드
5.2.2 기존 이미지 사용
미리 만들어진 이미지를 사용할 수도 있습니다.
5.2.3 SSE 전송 사용
Docker로 SSE 서버를 실행합니다.
docker run -i --rm -p 8001:8000 overseer66/mcp-comfyui-ssemcp.json
구성합니다(필요한 경우 localhost를 IP 또는 도메인으로 변경합니다):{ "mcpServers": { "comfyui": { "url": "http://localhost:8001/sse" } } }
참고: 새로운 워크플로를 도구로 추가하는 경우 Docker 이미지를 다시 빌드하고 다시 배포해야 사용할 수 있습니다.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
ComfyUI와 MCP를 통합한 서버로, 사용자가 이미지를 생성하고 자연어 상호작용을 통해 다운��드할 수 있도록 해줍니다.
Related MCP Servers
- -securityAlicense-qualityThe Comfy MCP Server uses the FastMCP framework to generate images from prompts by interacting with a remote Comfy server, allowing automated image creation based on workflow configurations.Last updated -30MIT License
- AsecurityAlicenseAqualityAn MCP Server that integrates with Stability AI's API to provide high-quality image generation, editing, and manipulation capabilities including background removal, outpainting, search-and-replace, and upscaling.Last updated -8278MIT License
- AsecurityAlicenseAqualityA MCP server that integrates with Stable Diffusion WebUI to provide text-to-image generation and image upscaling capabilities through simple API calls.Last updated -524MIT License
- -securityFlicense-qualityThis MCP server enables interaction with the Giphy API through natural language, allowing users to search, retrieve, and manage GIFs through the Multi-Agent Conversation Protocol.Last updated -