AI 视频生成技能,基于 ComfyUI 的 MCP 服务
bash
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
bash
docker-compose up -d
变量说明默认值COMFYUI_HOSTComfyUI 服务器地址localhostCOMFYUI_PORTComfyUI 端口8188LOG_LEVEL日志级别INFO
编辑 config/config.yaml:
yaml
comfyui:
host: localhost
port: 8188
timeout: 300
server:
transport: http
host: 0.0.0.0
port: 18060
path: /mcp
bash
# HTTP 模式
python server.py --transport http --host 0.0.0.0 --port 18060
# stdio 模式
python server.py --transport stdio
python
generate_video(
prompt="一个机器人在跳舞",
duration=5,
width=512,
height=512,
fps=12
)
python
check_progress(prompt_id="xxx-xxx-xxx")
python
download_video(prompt_id="xxx-xxx-xxx")
在 nanobot 配置中添加:
json
{
"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"
}
}
}
}
bash
# 克隆 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