
Comfyui Mcp
io.github.miller-joe由 GitHub 账号 miller-joe 发布v0.2.1更新于 Oct 24, 2026
MCP server for ComfyUI: text-to-image, variations, img2img refine, upscale, image proxy.
概览
一个本地 MCP 服务器,把助手连接到 ComfyUI 实例,使其能根据文本提示和工作流生成、精修、放大并生成图像变体。
- 可以做什么
- 根据文本提示生成图像,可控制负面提示、尺寸、步数、cfg 和种子,并按不同种子批量生成同一提示的变体。对已有图像执行 img2img 去噪精修、放大,以及基于 ControlNet 图像或 IP-Adapter 参考图的条件生成。运行任意 ComfyUI 工作流 JSON,以及 txt2img、img2img、upscale、ControlNet、IP-Adapter 内置模板。保存、列出、读取、删除并运行存放在磁盘上的命名工作流模板。列出可用的 checkpoint、LoRA、采样器和调度器,并把参考图上传到 ComfyUI。
- 适用场景
- 当你已经运行 ComfyUI 实例,希望助手在对话中直接驱动图像生成、变体、精修、放大或自定义工作流,而不必切换到 ComfyUI 界面时使用。
- 运行要求
- 需要一个可通过 HTTP 访问的 ComfyUI 实例,由 COMFYUI_URL 指定(默认 npm 包需要 Node.js 20+,也可使用 Docker 镜像。当客户端无法直接访问 ComfyUI 时可选设置 COMFYUI_PUBLIC_URL;COMFYUI_DEFAULT_CKPT 需指向 ComfyUI 的 models/checkpoints 目录中存在的 checkpoint。ControlNet 与 IP-Adapter 工具需要在 ComfyUI 中安装对应模型和自定义节点。
安装
在 SourceWeft 中
- 打开 控制台中的 Comfyui Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
comfyui-mcp
MCP server for ComfyUI. Generate images from natural language prompts in any MCP-compatible client.
Status
v0.2 ships the core tools plus upscale, an image proxy, and public-URL support. Current tool surface: generate_image, generate_variations, generate_with_workflow, refine_image, upscale_image, list_models, list_workflows, upload_image, generate_with_controlnet, generate_with_ip_adapter, plus a workflow template registry. See Roadmap for what's next.
Install
npx (no install required)
npm
Docker
Connect an MCP client
Claude Code:
Or register the streamable HTTP endpoint with an MCP gateway (e.g. MetaMCP) to aggregate with other servers.
Configuration
All options can be set via CLI flag or environment variable:
Transports
The server speaks streamable HTTP by default (great for Claude Code, MetaMCP, raw fetch). Pass --stdio (or set MCP_TRANSPORT=stdio) to switch into stdio mode, which is what stdio-first clients like Claude Desktop and the MCP Inspector expect:
Image URLs returned to clients
Generation tools return image URLs like <comfyui-public-url>/view?filename=…. If --comfyui-public-url is not set, URLs use the internal --comfyui-url value.
The server also exposes a proxy endpoint: GET /images/<filename>?subfolder=&type=output streams the image bytes through this server, which is useful when clients can reach the MCP server but not ComfyUI directly.
The default checkpoint must match a file in your ComfyUI models/checkpoints/ directory. Override via COMFYUI_DEFAULT_CKPT or pass checkpoint as a tool argument.
Tools
generate_image
Generate an image from a text prompt using ComfyUI's default txt2img workflow.
Parameters: prompt (required), negative_prompt, width, height, steps, cfg, seed, checkpoint.
generate_variations
Generate multiple variations of the same prompt by varying the seed. Returns all images at once.
Parameters: prompt (required), count (2–16, default 4), plus the same generation params as generate_image, with base_seed instead of seed.
generate_with_workflow
Submit an arbitrary ComfyUI workflow JSON (full node graph) and return the resulting image URLs. Use this for custom workflows — ControlNet, upscaling, or anything exported from ComfyUI's Save (API Format).
Parameter: workflow (object), the complete node graph.
refine_image
Run img2img on a source image. The server fetches a source URL, uploads it to ComfyUI, and runs a denoising pass guided by a new prompt. Lower denoise preserves more of the original; higher gives the prompt more freedom.
Parameters: prompt, source_image_url (required), denoise (0–1, default 0.5), plus standard generation params.
list_models
List available checkpoints, LoRAs, samplers, or schedulers on the ComfyUI instance.
Parameter: kind, one of checkpoints (default), loras, samplers, schedulers.
list_workflows
List built-in workflow templates shipped with this server (currently txt2img, img2img, upscale, controlnet, ip_adapter).
upload_image
Upload a reference image to ComfyUI for use in img2img, ControlNet, or IP-Adapter workflows.
Parameters: source_url or image_base64 (one required), filename (optional), overwrite (default false).
Returns: the stored filename, which can be used as the image input in workflow nodes like LoadImage.
generate_with_controlnet
Generate an image conditioned by a ControlNet preprocessed image (pose skeleton, depth map, canny edges, normal map, etc.) plus a text prompt.
Parameters: prompt, control_image_url (the preprocessed conditioning image; this tool doesn't run preprocessors), controlnet_model (filename from models/controlnet/), strength (0–2, default 1), start_percent / end_percent (0–1, controlling when CN is active during sampling), plus standard generation params.
Requires a ControlNet model installed in your ComfyUI models/controlnet/ directory.
generate_with_ip_adapter
Generate an image using a reference image as a visual/style/subject guide via IP-Adapter.
Parameters: prompt, reference_image_url, preset (e.g. "STANDARD (medium strength)", "PLUS FACE (portraits)", "VIT-G (medium strength)"), weight (0–3, default 1), start_at / end_at (0–1), plus standard generation params.
Requires the ComfyUI-IPAdapter-plus custom node pack plus the preset's matching IPAdapter weights and CLIP Vision models.
Workflow template registry
Save complex workflow JSON once, run by name later. Templates are stored on disk under --templates-dir (defaults to ~/.config/comfyui-mcp/templates/<name>.json) so they survive restarts and are portable across MCP clients.
Template names must start alphanumeric. Allowed: a-z, A-Z, 0-9, -, _. Max 64 chars.
Return format
All generation tools return image URLs served directly by the ComfyUI instance (http://<comfyui>/view?filename=…). These URLs can be passed straight to any client that accepts image URLs.
Architecture
The server is stateless. A single MCP request submits a workflow to ComfyUI, polls /history/{id} until complete, and returns image URLs.
Development
Requires Node 20+.
Roadmap
Shipped in v0.2:
generate_image,generate_variations,generate_with_workflowrefine_image(img2img from a source URL)upscale_image(ESRGAN / SwinIR-style model upscale)list_models,list_workflows,upload_image- Image proxy endpoint (
/images/<filename>) for clients that can't reach ComfyUI directly - Configurable public URL for externally-correct image URLs
- Workflow template registry (save/list/get/delete/run)
generate_with_controlnet(requires ControlNet models on the ComfyUI side)generate_with_ip_adapter(requires ComfyUI-IPAdapter-plus pack)
Planned:
- WebSocket progress events for long-running generations.
License
MIT © Joe Miller
Support
If this tool saves you time, consider supporting development:
Every contribution funds maintenance, documentation, and the next release.
来源:README.md,提交 9f3481f
工具
0版本历史
1- v0.2.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分