AI 视频生成技能,基于 ComfyUI 的 MCP 服务
cd /root/.nanobot/workspace/skills
git clone https://github.com/lemnt-ai/comfyui-mcp-server.git comfyui-mcp-skill
cd comfyui-mcp-skill
pip install -r requirements.txt
docker-compose up -d
| 变量 | 说明 | 默认值 |
|---|---|---|
| ------ | ------ | -------- |
| COMFYUI_HOST | ComfyUI 服务器地址 | localhost |
| COMFYUI_PORT | ComfyUI 端口 | 8188 |
| LOG_LEVEL | 日志级别 | INFO |
编辑 config/config.yaml:
comfyui:
host: localhost
port: 8188
timeout: 300
server:
transport: http
host: 0.0.0.0
port: 18060
path: /mcp
# HTTP 模式
python server.py --transport http --host 0.0.0.0 --port 18060
# stdio 模式
python server.py --transport stdio
generate_video(
prompt="一个机器人在跳舞",
duration=5,
width=512,
height=512,
fps=12
)
check_progress(prompt_id="xxx-xxx-xxx")
download_video(prompt_id="xxx-xxx-xxx")
在 nanobot 配置中添加:
{
"mcpServers": {
"comfyui": {
"command": "python",
"args": ["/root/.nanobot/workspace/skills/comfyui-mcp-skill/server.py"],
"cwd": "/root/.nanobot/workspace/skills/comfyui-mcp-skill",
"env": {
"COMFYUI_HOST": "localhost",
"COMFYUI_PORT": "8188"
}
}
}
}
# 克隆 ComfyUI
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
# 安装依赖
pip install -r requirements.txt
# 启动
python main.py --listen 0.0.0.0 --port 8188
工作流配置文件位于 workflows/ 目录:
| 文件 | 说明 |
|---|---|
| ------ | ------ |
| video_workflow.json | 视频生成工作流 |
| storyboard_workflow.json | 分镜生成工作流 |
| compose_workflow.json | 视频合成工作流 |
A: 检查 ComfyUI 服务是否正常运行,端口是否正确。
A: 视频生成依赖 GPU,确保有可用的 GPU 资源。
A: 编辑 workflows/ 目录下的 JSON 文件。
创建时间:2026-03-17
版本:v1.0.0
共 1 个版本