ComfyUI MiniMax H3 Myang
Long-video directing, native temporal anchors, media-aware prompting, AV stitching and optional refinement for MiniMax H3 in ComfyUI.
Nodes (55)
How Myang stitches two H3 segments together
H3AnchorKeyframe for precise control
The cleanup step that keeps anchored video the right length
H3 Audio Refine Mask, explained
H3 Audio Refine Sampler, explained
Your long H3 video clicks at every join. This is the node that kills the click.
The audio knobs the H3 Director reads — and where they actually go
Prompt + media in, real H3 conditioning and a latent out
Why a 16GB card dies during conditioning, and the barrier node that stops it
CPU upscale then a gentle H3 redraw, for the pixel path
The standalone master switch for the long-video second pass
One node that runs a whole storyboarded H3 shoot
Load one video, get a whole segment plan
Face refine and motion repair for H3 — if you happen to have the other two packs
Pulling one character image out of the Director's shared media bag
Fit an H3 storyboard to the rough cut you actually marked
Resume a long H3 render from segment 4 without redoing 1, 2 and 3
H3DirectorPlanValue
Bind a turnaround sheet to every shot instead of uploading it nine times
Stop your long video from slowly drifting green and dim
Fps divided into frames — and why H3 needs a node for it
A node that deliberately does nothing
Pass 2 doesn't need the anchor twice
Upscale the video latent, keep the audio bit-exact, skip the VAE round trip
The Myang loader that starts every workflow
One node that expands into a whole multi-segment sampling chain
Swap the reference video per segment without breaking your mentions
Pulling the H3 model out of the bundle so you can patch it
The legacy twin of '取模型' you can still use
Hand the VRAM back when the video is actually finished
Load the checkpoint instead of re-sampling it
Save the exact pass-1 latents so a re-render isn't a re-sample
Only kept the finished clip? Re-encode it back into pass 2
Upscale without the VAE round trip that eats your sharpness
The barrier that runs before conditioning, not after
Why the Director says 'preparing' instead of just freezing
The node that makes the Director panel show real progress
The audio twin of the reference slicer
Slicing the action video into per-segment chunks
Keep reference video memory sane, capped at 1080P
Pass 2 should start with more VRAM than pass 1, not less
In/out points on a timeline, turned into H3 constraints
There's a write-back switch on H3RoughCutSave, and it starts switched off
The sampler that shows you real frames at every step, not blurry mush
Turn a 2-minute script into a shot list MiniMax H3 can actually render
The node that hides where MiniMax H3's segments meet
Stitch every segment back together without wasting VRAM on the ones you skipped
The node whose only job is to make segment 4 possible
Pull one shot's prompt out of the plan — or let the LLM polish just that segment
Don't decode every shot's footage at once
How a cut gets the motion on the far side of it
Load the LightX2V Turbo LoRA without guessing the video/audio shift pair
Sharpening at 1:1, in the one slot where RTX VSR survives
An LLM writes your H3 prompt — and checks every @video2 reference actually exists
See what the Media Agent actually wrote, without reading raw JSON
ComfyUI-MiniMaxH3-Myang
Long-video direction, segmented generation, multi-keyframe continuity, and AV stitching for MiniMax H3.
<a href="./README.md"><img src="https://img.shields.io/badge/🇬🇧_English-0b8cf5" alt="English"></a> <a href="./README.ZH_CN.md"><img src="https://img.shields.io/badge/🇨🇳_中文简体-e9e9e9" alt="中文简体"></a>
Author and maintainer: 沐阳Myang<br> Bilibili: 沐阳Myang · GitHub: @civilcoco
</div>This node pack turns MiniMax H3 clip generation into a long-video workflow. It plans shots on H3's time grid, generates picture and sound segment by segment, carries the tail of one segment into the next as temporal context, trims the overlap, and joins the delivered clips.
The core nodes call ComfyUI's official MiniMax H3 interfaces directly and do not require another third-party custom-node pack. Model weights, LoRAs, and demo media are not distributed here.
[!IMPORTANT] The node code is licensed under GPL-3.0-only. The continuity implementation includes GPL-3.0 code adapted and further developed from ComfyUI-H3-Motion-Context. See THIRD_PARTY_NOTICES.md for audited revisions, modification boundaries, and the other third-party notices.
[!CAUTION] MiniMax H3 models and their outputs are governed by a separate community license that may include regional restrictions. Before downloading a model or publishing generated material, read LEGAL.md and the model publisher's current terms.
Features
- Director — organize text-to-video, video continuation, and motion-transfer jobs in one node.
- Storyboards and long video — arrange shots manually or ask an LLM to split a script by duration.
- AV continuity — extract temporal context from the previous latent and pin it at the head of the next segment.
- Media management — upload, preview, number, and validate shared or shot-specific media.
- Media Agent — optionally use an LLM/VLM to understand media and write valid H3 reference tags.
- Turbo scheduling — load a LightX2V Turbo LoRA and validate task family, steps, scheduler, and AV shift.
- Second-pass upscale — choose pixel, latent, neural 3D, or NVIDIA RTX VSR paths.
- Resume support — continue a motion-transfer job from a selected segment with the preceding AV seam context.
Installation
Use a recent ComfyUI build that includes the official MiniMax H3 nodes. Clone this repository into
ComfyUI/custom_nodes:
cd ComfyUI\custom_nodes
git clone https://github.com/civilcoco/ComfyUI-MiniMaxH3-Myang.git
Restart ComfyUI. The nodes appear under the 沐阳 H3 category. If the browser still shows the
pre-install UI, perform a hard refresh.
Provide your own copies of:
- a MiniMax H3 diffusion model;
- a Qwen text encoder;
- a video VAE;
- an audio VAE;
- any optional LoRA or upscaler required by your chosen path.
The core package declares no additional Python packages beyond the standard ComfyUI environment.
Install openai-whisper only when you select local Whisper transcription in the Media Agent. The
NVIDIA RTX VSR path requires a separately installed NVIDIA VFX runtime.
Optional enhancement packs
Two Director switches load third-party custom-node packs only when they are turned on. With the switches off, the core Director, native continuity, second pass, and audio chain never import them.
- 角色五视图 / 动作修复 use ComfyUI-MAINodes
(
H3ContactSheet,H3ContactSheetDecode,H3JerkOracle,H3TimeSmear,H3InjectSchedule,H3ExactRecover,H3AudioRecover) plus the five-view LoRA. - 小脸精修 uses ComfyUI-H3-FaceRefine
(
H3FaceTrackCrop,H3InjectVideoLatent,H3PerFrameDenoise,H3FaceStitch) and a face detector model. The long-video node checks for the nodes and the detector before sampling.
The regression tests that exercise those packs report SKIP when the packs are not installed.
Quick start
Start with:
example_workflows/Minimax_H3_Myang_Director_CN.json
- Select the diffusion model, CLIP, video VAE, and audio VAE in
沐阳 H3 加载器. - Choose text-to-video, video continuation, or motion transfer in the Director.
- Enter a script, or fill in the title, prompt, and duration on each manual shot card.
- Upload shared or shot-specific media. Refer to a specific item with
@图片N,@视频N, or@音频N. - Render only two segments first. Use 22 context frames and inspect the picture, motion, lip sync, and audio at the join.
- Once the seam is sound, increase the segment count or enable Turbo or a second pass.
For a graph with individually wired stages, open:
example_workflows/Minimax_H3_Myang_LongVideo_CN.json
That example also demonstrates optional integrations from VideoHelperSuite, KJNodes, SolAttn, Spectrum, ReservedVRAM, and Easy-Use. They are not Python import dependencies of Myang. Install the packages needed by the branches you use, or bypass/remove those nodes.
Both examples have been sanitized. Select your own model names, media, prompts, output name, and seed after loading.
Director
沐阳 H3 · 导演台(全功能) offers two ways to build a timeline:
- Manual storyboard — set a title, prompt, duration, and media on each shot card. Durations snap
to H3's supported
17k+5frame grid. Each shot accepts up to 9 images, 3 videos, and 3 audio files. - Agent / long-script split — let an LLM build the timeline from the total duration, per-segment duration, media inventory, and writing rules. With the LLM disabled, the input prompt follows the local splitting path and consumes no tokens.
Use the Director's shared-media area for character images, locations, reference video, or music used
throughout the job. Media on a shot card belongs to that shot. Each card can use only its own media or
append the shared inventory. Workflows store portable ComfyUI/input references; they do not embed
the media payload in the JSON.
A motion-transfer shot can select its own action source. When it does not, the Director uses the global
ref_video input. Motion transfer and video continuation accept one direct reference video; image and
audio references remain available as normal.
Media references
Each media type has an independent index:
@图片1 @图片2
@视频1 @视频2
@音频1 @音频2
The Media Agent converts these editor-facing labels into the official H3 <Picture N>, <Video N>,
and <Audio N> forms, and checks that every label maps to connected media. A VLM can describe image
and video contents; Whisper can add an audio transcript.
LLM services
Open ComfyUI Settings, select Myang_node, and open LLM Service Settings. The panel supports:
- OpenAI-compatible APIs;
- Ollama;
- multiple URL/API-key routes in one service;
- round-robin or primary-route-first selection;
- route cooldown and failover after rate limits, timeouts, or service errors.
The configuration read endpoint never returns API keys to the browser. Leave the key field empty when
editing a service to keep its stored value. Configuration is saved under
user/default/Myang_node/config/llm_services.json in the ComfyUI user directory. LLM/VLM calls are
implemented by this package; Prompt Assistant is not required.
Continuity and seam handling
segment N temporal latent
↓
extract tail video and audio context
↓
pin multi-keyframe context at the head of segment N+1
↓
sample → trim the overlap in sync → blend the seam → concatenate
Video follows a 24fps timeline. Audio placement follows H3's 40Hz time grid. The seam node applies a short waveform blend at the real cut and trims each audio segment to the delivered picture duration.
In a manually wired graph, H3ScriptSplitter.overlap_frames must match
H3LongVideo.context_length.
| Context frames | Temporal blocks | Suggested use | |---:|---:|---| | 5 | 2 | Experimental short context; faster with weaker constraint | | 22 | 7 | Recommended starting point; about 0.92 seconds | | 39 | 12 | Stronger motion and composition continuity | | 56 | 17 | Longest context; highest token and trimming cost |
Context consumes conditioning tokens and is trimmed from the delivered portion of every later segment. Establish a two-segment baseline with 22 frames before comparing another length on the same inputs.
The smart splitter labels each boundary as a continuation or a cut. Both use temporal anchors. A cut is described by the next shot's prompt; it is not a black frame, flash, or post-production hard cut.
Turbo
沐阳 H3 · Turbo LoRA 联合音画加载调度 calls ComfyUI's LoRA loader and applies the paired H3
video/audio shifts. The following table lists the presets implemented by this package:
| LightX2V preset | Video/audio shift | Inference NFE | Training resolution | |---|---:|---:|---| | v1.0 8-step | 12 / 3 | 8 or 4; start with 8 | Mixed 544p ratios | | v1.0 4-step 768P | 6 / 3 | 4 | 1344×768 | | v0.1 4-step | 12 / 3 | 4 | Mixed 544p ratios | | Ref2VA v0.1 4-step | 12 / 3 | 4 | Mixed 544p ratios |
Turbo follows a fixed NFE trajectory and requires the simple scheduler, denoise=1.0, and an Euler
sampler. Prefer an FL2VA/T2VA preset for generation and a Ref2VA preset for motion transfer.
The upstream project may publish additional checkpoints. In v0.1.0, the upstream 8-step v1.0 768P checkpoint has no dedicated Myang profile; do not use filename-based Auto detection for it. Use only a preset listed above unless you have independently validated a manual shift, or wait for a package update that adds the checkpoint explicitly.
The Turbo node keeps a legacy speed_cache widget so older workflows still validate, but the
built-in TE-Speed and Spectrum mounts are disabled: both retained opaque cache/history state and
were unsafe to compose with the current H3 attention and memory patch chain. A saved value other
than 关闭 is ignored with a log line. After the official Turbo LoRA the node can stack up to three
ordinary H3 effect LoRAs without changing the official schedule.
Preset sources: LightX2V model page and publisher ComfyUI workflows.
Second-pass upscale
The Director and 沐阳 H3 · 二采放大设置 provide three modes:
- upscale, then run a second pass;
- second pass at the same resolution;
- upscale only, with no second pass.
Available paths are pixel/VAE projection, neural 3D latent, and NVIDIA RTX VSR. The former bislerp
latent option was removed from the second-pass menu: on H3's temporally compressed latent it blends
cells that decode into different motion states and ghosts, and its documented cure (a VAE decode →
encode projection) is the pixel path. It remains reachable on 沐阳 H3 · Latent 直接放大 with vae
unwired. Long videos are processed one segment at a time. Final audio comes directly from the first
pass and receives only seam handling and duration trimming. Use a Ref2VA base model without a Turbo
LoRA for the second pass; the Director refuses a Turbo output on the 二采模型 socket.
The second pass reuses the first pass's conditioning by default (复用文本/素材条件). Rebuilding it
at the second-pass canvas re-fits every reference image to the larger area and changes the reference
token layout the low-denoise pass is asked to converge to, which shows up as smearing and slight
identity drift. The memory profile block controls how much VRAM the pass keeps free and how often
clear step previews decode; on 16 GB Windows cards the automatic profile evicts pass-1, VAE and
upscaler residency before the pass-2 model loads and retries once with pages evicted after a real OOM.
The neural 3D path accepts LBH-123-AI's 24-channel H3 Latent Upscaler weights. Download the checkpoint separately and place it in:
ComfyUI/models/latent_upscale_models/
Weights and documentation: LBH-123-AI/Minimax_h3_latent_Upscaler
Start with fp16 and temporal chunk 0 (one full-context pass, no seams). Raise the chunk to 16 or
8 only when memory is tight; chunk boundaries are cross-faded rather than butt-joined. Try fp32 if
the result shows precision artifacts or color blocks.
Main nodes
| Node | Purpose | |---|---| | 沐阳 H3 · 导演台(全功能) | Organize storyboard, media, generation, seams, and optional second pass | | 沐阳 H3 加载器 | Configure Ref2VA/FL2VA models, CLIP, video VAE, and audio VAE | | 沐阳 H3 条件(提示词 + 素材) | Build official H3 conditioning and reference media | | 沐阳 H3 · Media Agent | Preview, number, describe, and validate media references | | 沐阳 H3 · 分段计划 | Calculate segment count, frame lengths, and overlaps | | 沐阳 H3 · 长视频(原生多关键帧) | Expand and execute a multi-segment sampling chain | | 沐阳 H3 · 任意位置关键帧 | Pin a keyframe at an arbitrary supported position; chainable | | 沐阳 H3 · 段间多关键帧 | Carry temporal latent context between adjacent segments | | 沐阳 H3 · 锚点同步裁剪 | Trim anchored picture and sound in sync | | H3 接缝淡化 | Blend picture/waveform cuts and enforce the delivery duration | | 沐阳 H3 · Turbo LoRA 联合音画加载调度 | Load a LoRA and validate the Turbo parameter contract | | 沐阳 H3 · 二采放大设置 | Configure second-pass modes and parameters for long video | | 沐阳 H3 · 二采放大精修(像素路径) | Run pixel upscale and low-denoise redraw | | 沐阳 H3 · Latent 直接放大(极速双采) | Run a latent-space upscale path | | 沐阳 H3 · 段间漂移校正 | Optionally correct accumulated brightness and color drift |
Nodes marked 内部 are managed by the Director or long-video expansion and normally do not need manual wiring.
Compatibility and limitations
- CPU structural regression tests cover the H3 layouts in ComfyUI
v0.33.2andv0.34.0, and the package is exercised againstv0.33.2(7cee3ceb1) on the author's machine. After a ComfyUI update, validate a two-segment render before starting a long job. - Resolution must remain constant between segments when continuity uses temporal latents.
- Long chains can accumulate losses in picture detail, timbre, brightness, and saturation. A clean seam does not guarantee that content quality will remain constant down the chain.
- Turbo, cache nodes, attention patches, and second-pass processing all change speed, memory use, or quality. Troubleshoot against a plain two-segment baseline first.
- ComfyUI-H3-Motion-Context is not an installation dependency. If it is also present in
custom_nodes, use only one H3 continuity implementation in a job and restart ComfyUI before switching graphs. - CPU tests verify graph structure, time coordinates, reference order, and trim lengths. They cannot replace a real-model visual and audio review.
Testing
Run from PowerShell:
pwsh tools\run_tests.ps1 -ComfyRoot D:\path\to\ComfyUI
The suite covers stock head/tail equivalence, multi-keyframes, image/video/audio reference ordering, 5/22/39/56-frame temporal blocks, the 40Hz audio grid, seam trimming, the Media Agent, LLM configuration, Turbo contracts, the Director, and second-pass expansion. When Node.js is available, it also runs the frontend structure and LLM service-panel tests.
Provenance and license
- Repository license: GPL-3.0-only.
- Primary adapted source: ComfyUI-H3-Motion-Context, GPL-3.0.
- Neural latent-upscale runtime reference: ComfyUI MiniMax H3 Director, Apache-2.0.
- Full copyright, audited revisions, modification boundaries, and optional integration notes: THIRD_PARTY_NOTICES.md.
- Version history: CHANGELOG.md.
Please report issues with reproducible examples through GitHub Issues.