comfy-h3-mcp

comfy-h3-mcp

Enables MiniMax-H3 video+audio generation on a local ComfyUI via five simple tools, including image/reference-to-video, job polling/cancelling, and asset listing, with stateless prompt_id-based job handling.

Category
访问服务器

README

comfy-h3-mcp

A small MCP server for driving MiniMax-H3 video+audio generation on a local ComfyUI. Seven tools, not a general ComfyUI control plane — the point is to keep the agent's context cost near zero for the one thing this rig actually does.

Tools

Tool What it does
h3_image_to_video Text-to-video, or keyframe-guided via first_frame / last_frame (fl2va model)
h3_reference_to_video Prompt + reference images / videos / audio (ref2va model)
job_status Poll a prompt_id → queued / running / completed / failed + output URLs
job_cancel Drop from queue if pending, interrupt if running
grab_reference Save a frame of a finished clip as a reusable reference still
list_assets H3 models present, and input files usable by name

Generation takes minutes, so the two generate tools submit and return a prompt_id immediately. There is no session state — the prompt_id is the only handle, and ComfyUI already owns it.

Setup

uv venv && uv pip install -e .
claude mcp add comfy-h3 -s user \
  -e COMFYUI_URL=http://127.0.0.1:8188 \
  -- /path/to/comfy-h3-mcp/.venv/bin/comfy-h3-mcp

COMFYUI_URL defaults to http://127.0.0.1:8188.

Timing

Generation takes minutes. Every submit returns estimated_seconds plus a suggested poll interval, so a client knows the difference between "slow" and "stuck". Measured on an RTX 4090 at 124 frames:

Config Time
864×480, 20 steps, sage 3m 43s
864×480, 24 steps, sage 4m 11s
1344×768, 30 steps, sage 13m 13s
1344×768, 30 steps, no sage 18m 02s

The estimator scales with pixels × steps × length and predicts all four within 5.2%. Roughly 30 s of that is cold model load, which no setting reduces — the nvfp4 text-encoder path is emulated on this hardware.

Draft small, finish large. 864×480 is the template's draft setting; the model's documented full-quality 16:9 target is ~1.0 MP (1344×768). Iterate prompts at the default, then re-run keepers at 1344×768 with the same seed — noting that a seed does not guarantee an identical image across a resolution change, only a related composition.

Sage attention

list_assets reports sage_attention.global, detected by inspecting the ComfyUI process for --use-sage-attention (local servers only; None when it can't be determined). When sage is global, the per-call sage_attention parameter is redundant — the tool descriptions tell clients not to set it and not to recommend enabling sage, which otherwise happens: an agent that can't see the launch flag will report a normal run as "grinding" and advise a no-op fix.

Sage gives roughly 1.36× here. It is a lossy approximation: same seed produces a different sample, not the same one faster (SSIM 0.78 on luma, audio differs too). Keep it in a fixed state once you lock a seed.

Required models

Loaded by name, so they must be present:

  • models/diffusion_models/minimax_h3_fl2va_pruned_int8_convrot.safetensors
  • models/diffusion_models/minimax_h3_ref2va_pruned_int8_convrot.safetensors
  • models/vae/minimax_h3_video_vae_fp16.safetensors
  • models/vae/minimax_h3_audio_vae_fp32.safetensors
  • models/text_encoders/qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors

list_assets reports anything missing.

Notes on the model's constraints

These are enforced in graphs.py, mirroring comfy_extras/nodes_minimax_h3.py, so callers see the real numbers up front rather than discovering that ComfyUI snapped them:

  • Length is a frame count at 24 fps, snapped up to the 17k+5 grid. 124 ≈ 5.2 s. Trained range is roughly 124–362; longer is untested.
  • Canvas is capped at 768×1344 pixels of area with each axis rounded to 32. Oversized requests are re-fitted via the model's own adapt_canvas rule, so 1920×1080 becomes 1344×768.
  • References are addressed positionally in the prompt as <Picture i>, <Video k>, <Audio j> — all 1-based per type. Max 9 images, 3 videos, 3 audio. A reference video's soundtrack is wired through automatically.
  • Prefer stills to reference videos. ref_videos carry identity poorly and drag their own soundtrack into the output, fighting the audio the prompt asked for. Use grab_reference to lift a frame from an earlier clip instead: run job_preview, pick a tile off the contact sheet, and grab_reference( prompt_id, tile=N) saves that exact source frame at full resolution into ComfyUI's input folder, ready to pass as ref_images.
  • ref_image_size="max" uses a 2048 px short edge for better identity fidelity but is several times slower, because reference tokens ride through every sampling step.

Defaults

These mirror the official video_minimax_h3_t2v.json template, verified node-for-node:

Value
Resolution 864×480 — 16:9 at 0.4 MP, rounded to 32
Steps 20
Sampler res_multistep
Scheduler simple, denoise=1.0
Guidance BasicGuider — no CFG, no negative conditioning
Sigma shift nonesupported_models.py already applies shift=12.0

Pass width/height explicitly to override the megapixel calculation, or raise megapixels. Note the cost: 1344×768 is 2.5× the pixels of the default, and res_multistep is a higher-order sampler, so 20 steps here is not a downgrade from 30 steps of euler — it is faster and comparable in quality.

shift_video/shift_audio default to None, which omits MiniMaxH3SigmaShift entirely. Set either one to insert the node and override the model default.

Graph shape

UNETLoader ──────────────────────┐
CLIPLoader(minimax) ─┐           ├─► BasicGuider ─┐
VAELoader(video) ────┼─► MiniMaxH3{ImageToVideo,  │
VAELoader(audio) ────┘      ReferenceToVideo}     │
                        │ positive ───────────────┘
                        └─ latent ────────────────┐
                                                  │
RandomNoise ─┐                                    │
KSamplerSelect(res_multistep) ─┼─► SamplerCustomAdvanced ◄┘
BasicScheduler(simple, 20) ────┘         │
                                         ├─► VAEDecode(video vae) ─────┐
                                         └─► VAEDecodeAudio(audio vae) ┤
                                                                       ▼
                                                  CreateVideo(24fps) ─► SaveVideo

Both VAEs read the joint AV latent directly — the nested video/audio pair needs no explicit split node. (LTXVSeparateAVLatent does work here despite the name, but the template doesn't use it and neither do we.)

Autogrow reference inputs serialize as dotted API keys (ref_images.ref_image_0, ref_video_audios.ref_video_audio_0), per finalize_prefix() in comfy_api/latest/_io.py.

Requires

MCP SDK 2.0+ (MCPServer; FastMCP was removed).

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选