comfy-h3-mcp
This server drives MiniMax-H3 video and audio generation on a local ComfyUI instance. You can:
Generate videos using
h3_image_to_video(text-to-video or keyframe-guided with first/last frame) andh3_reference_to_video(prompt plus reference images, videos, or audio for consistency).Manage jobs with
job_status(poll progress and get output URLs), andjob_cancel(cancel pending or running jobs).Preview results via
job_preview(contact sheet of frames and soundtrack).List assets with
list_assets(available models, input files, and system settings like sage attention).
Provides a tool to generate a keyframe image using OpenAI's GPT Image API, which can be used as the first frame for H3 video generation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@comfy-h3-mcp Generate a video from the prompt: a dragon soaring over a castle"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
comfy-h3-mcp
A small MCP server for driving MiniMax-H3 video+audio generation on a local ComfyUI. Eight 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 |
| Text-to-video, or keyframe-guided via |
| Prompt + reference images / videos / audio (ref2va model) |
| Poll a |
| Drop from queue if pending, interrupt if running |
| Return a contact sheet and soundtrack for a finished clip |
| Save a frame of a finished clip as a reusable reference still |
| Generate and upload a GPT Image keyframe (metered API) |
| 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.
Related MCP server: ComfyUI MCP Server
Acceleration presets
Both generation tools accept one acceleration value:
Preset | Stack | Use |
| Native H3 path (global Sage still applies) | Native-trajectory A/B reference |
| Sol-Attn, | Quality-sensitive accelerated renders |
| Sol-Attn, | Normal local generation |
| Sol-Attn, | Prompt and motion drafts |
These are inference-time approximations. They do not retrain or modify the
checkpoint, but they can change motion, fine detail, and audio for the same
seed. Keep off available as the reference and re-run important shots with
quality or off when fidelity matters.
The Sol-Attn custom node must be installed in ComfyUI:
cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-SolAttn_triton.gitlist_assets reports whether both SolAttnPatch and native EasyCache are
loaded. Sol-Attn's Triton kernels compile for each new tensor shape, so the
first run at a resolution/duration can be slower than subsequent warm runs.
ComfyUI GUI workflow
Load workflows/minimax_h3_sol_balanced.json
from ComfyUI's Workflows → Open menu. It is derived from ComfyUI's official
MiniMax-H3 text/image-to-video template and inserts the measured balanced path:
UNETLoader → SolAttnPatch → EasyCache → scheduler + guiderThe workflow opens at 0.4 MP, 5 seconds, and 20 RES multistep steps. Global
SageAttention remains controlled by the ComfyUI launch flag. The note inside
the workflow gives the quality, balanced, and fast settings.
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-mcpCOMFYUI_URL defaults to http://127.0.0.1:8188.
The optional gpt_image_first_frame tool also needs OPENAI_API_KEY in the
environment that launches the MCP server. It uses the metered GPT Image API;
the local H3 generation tools do not require that key.
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, 20 steps, sage + | 2m 33s |
864×480, 20 steps, sage + | 1m 52s |
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. Its accelerated factors are
fitted to the two local measurements above. balanced skipped 5/20 denoiser
evaluations; fast skipped 7/20. Roughly 30 s is fixed model load/decode work,
which these DiT optimizations do not remove — 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.safetensorsmodels/diffusion_models/minimax_h3_ref2va_pruned_int8_convrot.safetensorsmodels/vae/minimax_h3_video_vae_fp16.safetensorsmodels/vae/minimax_h3_audio_vae_fp32.safetensorsmodels/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+5grid. 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_canvasrule, 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_videoscarry identity poorly and drag their own soundtrack into the output, fighting the audio the prompt asked for. Usegrab_referenceto lift a frame from an earlier clip instead: runjob_preview, pick a tile off the contact sheet, andgrab_reference( prompt_id, tile=N)saves that exact source frame at full resolution into ComfyUI's input folder, ready to pass asref_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 |
|
Scheduler |
|
Guidance |
|
Sigma shift | none — |
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 ─► Sol-Attn ─► EasyCache ─┐
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) ─► SaveVideoBoth 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).
Available Tools
6 toolsh3_image_to_videoA
Generate video with synchronized audio from a text prompt, optionally anchored by a first and/or last keyframe (MiniMax-H3 fl2va model).
With no keyframes this is pure text-to-video. Images may be a local file path (uploaded automatically) or a name already in ComfyUI's input folder. length is a frame count at 24 fps and snaps up to the model's 17k+5 grid; 124 frames is about 5 seconds, and the trained range is roughly 124-362. Leave width/height unset: they default to 864x480, which is both faster and closer to the prompt than larger canvases. Only raise it if the user asks. This produces ONE continuous shot - it cannot contain cuts, so for a multi-shot sequence call this once per shot and edit the clips together rather than describing several shots in one prompt. Takes MINUTES: ~3-4 min at the defaults on an RTX 4090, longer at higher resolution or step count. The response carries estimated_seconds; poll job_status at that cadence instead of assuming a long run has hung. Do NOT set sage_attention without first checking list_assets - if ComfyUI runs with --use-sage-attention, sage is already on and this is redundant. Returns immediately with a prompt_id - poll job_status to get the output.
Inputs: prompt (required), seed, steps, width, +11 more.
h3_reference_to_videoA
Generate video with synchronized audio from a prompt plus reference images, videos, and/or audio (MiniMax-H3 ref2va model).
References are addressed positionally in the prompt as , and , all 1-based per type - e.g. "<Picture 1> walks through the door speaking in the voice of <Audio 1>". Max 9 images, 3 videos, 3 audio. A reference video's own soundtrack is passed through automatically. ref_image_size "match" scales references to the output's pixel area; "max" uses a 2048px short edge for better identity fidelity but is several times slower, since reference tokens ride through every step. This is the tool for CONSISTENCY ACROSS SHOTS: generate shot 1, pull a frame of the character or location from it, and pass it here as a reference for shots 2..n so they match. Leave width/height unset (864x480 default). Takes MINUTES; see estimated_seconds in the response and poll at that cadence. Check list_assets before setting sage_attention - it is redundant when ComfyUI already runs with --use-sage-attention. Returns immediately with a prompt_id - poll job_status to get the output.
Inputs: prompt (required), seed, steps, width, +13 more.
job_cancelA
Cancel an H3 job: removes it if still queued, interrupts it if running.
Inputs: prompt_id (required).
job_previewA
Look at and listen to a finished H3 job.
MCP has no video content type, so this returns a contact sheet of frames sampled evenly across the clip (viewable as an image) plus the soundtrack as audio. Use it to actually judge a result before iterating on the prompt.
Inputs: prompt_id (required), rows, columns, tile_width, +1 more.
job_statusA
Check a submitted H3 job. Returns queued / running / completed / failed, plus the output file paths once it has finished.
Inputs: prompt_id (required).
list_assetsA
List what this ComfyUI can actually load: H3 models, and the images, videos and audio already sitting in the input folder (usable by name).
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct role: job management (status, cancel, preview), asset discovery, and two generation tools with different use cases (keyframes vs. reference-based consistency). The generation tools are well-separated by their descriptions, leaving no ambiguity.
Names follow a predictable pattern within categories: job_* for job operations, h3_* for generation, and list_assets for assets. However, there is no single uniform verb_noun convention across all tools (e.g., job_cancel vs. list_assets), which is a minor deviation.
Six tools is well-scoped for this focused video-generation server. Each tool fills a necessary part of the workflow—submitting generation jobs, managing jobs, inspecting results, and listing available assets—with no redundant tools.
The tool set covers the full generation lifecycle: submit (two variants), poll status, cancel, preview, and list assets. A minor gap is the lack of a listing mechanism for all submitted jobs, which could be a workaround but is not critical.
Maintenance
Related MCP Connectors
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Remote MCP for RunComfy: ComfyUI deployments, hosted models, LoRA training. 31 tools.
AI video generation MCP server for Kling, MiniMax, Luma & Hunyuan with prompt blueprints.
Image and video AI tools and your own pipelines, run from any AI assistant.
Related MCP Servers
- AlicenseAqualityNot gradedmaintenanceEnables interaction with MiniMax AI APIs for text-to-speech, voice cloning, video generation, image generation, and music creation through MCP clients like Claude Desktop and Cursor.9MIT
- FlicenseBqualityDmaintenanceConnects AI assistants to ComfyUI for image, video, and audio generation, providing full control over ComfyUI through 40+ tools including quick generation, cloud API nodes, and custom workflow building.46-
- FlicenseNot gradedqualityCmaintenanceEnables video generation through ComfyUI workflows, providing tools to list workflows, create and manage video jobs, upload assets, and retrieve results.-
- AlicenseAqualityCmaintenanceEnables video generation via MiniMax's official V2 API using your own API key, integrating with mcode for submitting and querying video tasks, with automatic mp4 downloads.2MIT