Run this model with HF Jobs
Run MATLOWAI/MiniMax-H3-Variable-Clock on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/MATLOWAI/MiniMax-H3-Variable-Clock. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/MATLOWAI/MiniMax-H3-Variable-Clock on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use MATLOWAI/MiniMax-H3-Variable-Clock with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Inference
- Notebooks
- Google Colab
- Kaggle
Download docs/STAGE2_CLOCK_GUIDE.md from MATLOWAI/MiniMax-H3-Variable-Clock: direct link, hf CLI and curl.
- Browser
- Download file 15.1 kB
-
https://huggingface.co/MATLOWAI/MiniMax-H3-Variable-Clock/resolve/main/docs/STAGE2_CLOCK_GUIDE.md
- Command line
-
hf download hf://MATLOWAI/MiniMax-H3-Variable-Clock/docs/STAGE2_CLOCK_GUIDE.md
-
curl -L -o STAGE2_CLOCK_GUIDE.md https://huggingface.co/MATLOWAI/MiniMax-H3-Variable-Clock/resolve/main/docs/STAGE2_CLOCK_GUIDE.md
Stage-2 DeRoPE Clock Guide β What Works Well & How to Use It
This guide covers the experimental Stage-2 DeRoPE stack shipped on this branch (H3Stage2Clock + ready-to-drop workflows in examples/experimental/). Every default here comes from 80+ controlled ablations across 6 test clips (live-action panning shots and fast anime sword/vault action).
If you want the full story of what broke, which hypotheses failed, and how we found these fixes, read docs/STAGE2_CLOCK_JOURNEY.md.
1. The Four Levers That Actually Work
Lever 1 β Pop-Free K=3 Fine-Band Splice (keep_fine_bands = 3)
MiniMax-H3's temporal RoPE spectrum has periods:
- Band 0: 3.8 frames
- Band 1: 6.7 frames
- Band 2: 11.9 frames (1.43 turns inside one 17-frame VAE chunk)
- Band 3: 21.2 frames (first band slower than a 17-frame chunk)
Keeping 3 fine bands (keep_fine_bands = 3) leaves Bands 0β2 on the native stock grid while putting Band 3+ on the True Clock. That single change eliminates:
- Chunk-start white exposure flashes (
t % 5 == 0singletons jumping 25β30 luma levels underK=2), - Translucent multi-exposure ghosting on static backgrounds, and
- The 8-frame vertical camera bob that
K=2excites andhold = 4aliases into an every-other-frame buzz.
Lever 2 β Two-Pass Split (Ο β₯ 0.80 Clock β Ο β€ 0.571 Pure Native Stock)
Leaving any compressed temporal RoPE active during the final low-sigma detail steps (Ο = 0.571, 0.333) causes adjacent held frames to blend edges across time (blurry ghost boots, soft limbs).
Splitting the denoise cleanly at handoff_sigma = 0.65 solves it with zero extra steps:
- Pass 1 (
Ο β₯ 0.80):H3Stage2Clock(K=3+ optional RYS loop, with no LoRA or aK=3clock LoRA). - Pass 2 (
Ο β€ 0.571, final 2 steps): Pure native stock model +euler+DisableNoiseβ no True Clock, no clock LoRA, no RYS loop.
On Pika's 6-step schedule ([1.0, 0.973, 0.923, 0.80, 0.571, 0.333, 0.0]), handoff_sigma = 0.65 automatically splits every common entry point:
- Enter at
Ο = 0.973: 3 Pass-1 steps (0.973 β 0.923 β 0.80 β 0.571) + 2 Pass-2 stock steps (0.571 β 0.333 β 0.0). - Enter at
Ο = 0.923: 2 Pass-1 steps (0.923 β 0.80 β 0.571) + 2 Pass-2 stock steps. - Enter at
Ο = 0.800: 1 Pass-1 step (0.80 β 0.571) + 2 Pass-2 stock steps.
Lever 3 β Deterministic euler + Zero-Training Damped RYS Middle-Block Loop
Switching from stochastic lcm to deterministic euler removes re-noising jitter during the short Pass-1 window. Adding a zero-training RYS ("Repeat Your Self") middle-block loop during Pass 1 only β adapted from the LLM middle-layer duplication trick (David Noel Ng, 2024) into a DiT-safe damped residual loop that runs a middle window of DiT blocks once more and blends h = h_save + 0.20 * (h_loop - h_save) β dramatically improves spatial/temporal lock without retraining or the contrast/color overshoot of raw 100% looping:
16-32(Ξ± = 0.20): Best general balance and best when paired withSelfRefiningSamplerPlus(tight velocity control, razor-sharp anime swords, 3β4Γ calmer horizons).20-36(Ξ± = 0.20): Best withoutSelfRefiningSamplerPluson live-action walking/panning shots (preserves original warm palette and unlocks freer natural stride fluidity while keeping 3Γ calmer vertical stability than source).- Keep Pass 2 loop OFF: Looping both passes showed no benefit over Pass-1-only.
Lever 4 β Optional ComfyUI-SelfRefiningSamplerPlus at Fixed Ο (perturb_strength_scale = 1.0)
If you install ComfyUI-SelfRefiningSamplerPlus (implements arXiv:2601.18577 Predict-and-Perturb self-refinement and natively supports H3's NestedTensor audio-video latents), wiring SamplerSelfRefinePlus into H3Stage2Clock's sampler input gives a major jump in edge crispness and fast-action coherence (e.g. solid katana blades instead of smears, clean sparks, sharp tiles).
Two rules are critical when using SelfRefiningSamplerPlus on H3:
- Always set
perturb_strength_scale = 1.0(fixed-ΟP&P,uncertainty_metric = "l1_mean",uncertainty_threshold = 0.20,max_substeps = 2). Values> 1.0shift anime colors and can push dilated clips across theΟ > 0.92speed-up cliff. - Use the Identity-Locked curve when entering at
Ο = 0.973on character/anime shots:- Standard curve (best on
Ο = 0.973live-action silhouettes orΟ = 0.80):[[0.0, 1.0], [0.5, 0.5], [1.0, 0.5]]([2, 1, 1]substeps on 3 Pass-1 steps) - Identity-Locked curve (skips P&P on
Ο = 0.973so 97.3% noise cannot re-roll face/gender/camera angle, then refines onΟ = 0.923 & 0.800):[[0.0, 0.0], [0.5, 1.0], [1.0, 0.5]]([0, 2, 1]substeps on 3 Pass-1 steps)
- Standard curve (best on
2. Quick-Reference Recipe Matrix
| Scenario | Entry Ο |
Clock & Loop (H3Stage2Clock) |
Sampler | LoRA (Pass 1) | Why This Works |
|---|---|---|---|---|---|
| Live-action high-denoise (max smoothness + sharpness) | 0.973 |
K=3, RYS 16-32, Ξ±=0.20, handoff=0.65 |
SelfRefine+ (scale=1.0, standard curve) + euler |
None (or K=3 LoRA) |
Best overall temporal smoothness, calm horizon, zero ghost boots, no K=2 LoRA drag. |
| Live-action high-denoise (zero extra node packs / freer stride) | 0.973 |
K=3, RYS 20-36, Ξ±=0.20, handoff=0.65 |
Plain euler |
None (or K=3 LoRA) |
Exact original warm lighting, fluid walking stride, 3Γ calmer horizon than source, core nodes only. |
Anime / complex framing at high denoise (Ο = 0.973) |
0.973 |
K=3, RYS 16-32, Ξ±=0.20, handoff=0.65 |
SelfRefine+ (scale=1.0, Identity-Locked [0,2,1] curve) + euler |
None (or K=3 LoRA) |
Prevents Ο=0.973 camera/identity flips while sharpening swords, sparks, and flying debris and halving stutter. |
Fast-action anime at medium denoise (Ο = 0.80) |
0.800 |
K=3, RYS 16-32, Ξ±=0.20, handoff=0.65 |
SelfRefine+ (scale=1.0, 1 Pass-1 step) + euler (or plain euler) |
None (or K=3 LoRA) |
Solid sharp blades, zero background ghosting, exact source pose & palette. |
| Maximum source identity & color lock | 0.923 |
K=3, RYS 16-32, Ξ±=0.20, handoff=0.65 |
SelfRefine+ (scale=1.0, 2 Pass-1 steps) + euler |
None | Locks original face, silhouette, golden-hour warmth, and ~1.0Γ natural speed without touching Ο=0.973. |
Recommended
K=3Pass-1 LoRAs (optional β download fromMATLOWAI/MiniMax-H3-Variable-Clock): Everything in the table works with no clock LoRA at all. Legacyrun fwas trained atK=2, so insideK=3 + SelfRefine+ + RYS 16-32, droppingrun factually improved smoothness. Three dedicatedK=3sustained-hold LoRAs (trained across 108 clips / 27 live-action + anime sources with chunk starts insidehold=4plateaus) beat bothNO LoRAandrun facross all 4 benchmark scenes β always load on Pass 1 only and keep Pass 2 pure native stock:
LoRA file (Pass 1 only, strength 1.0)Trained on Best for Key measured wins (1 seed/scene) minimax_h3_variable_clock_k3_hisigma_flow_step1000_lateattn_r16.safetensorsHigh-sigma only ( Ο β [0.55, 1.00]), DIS smooth-flowK=3, blocks0-34+ late attention (lateattntrim)Best all-around Pass-1 LoRA (calmest horizon + lowest exit stutter + clean anime) pier:dy_hf 0.113 px,exSt 1.63,sharp 2.17;bamboo: solid red katana +held_dy_hf 0.354(2.7Γ calmer thanrun f);panrun:chunk 1.14minimax_h3_variable_clock_k3_flow_step400_r16.safetensorsFull-sigma DIS smooth-flow K=3, step 400 sweet spotSmoothest overall motion across live + anime pier:midSt 1.48(smoother than source1.51),f147pk 2.15Γ, clean RYSdy_hf 0.110 px;bamboo:1.004Γsharp,held_dy_hf 0.348;panrun:stutter 3.30;rooftop:chunk 0.41minimax_h3_variable_clock_k3_hisigma_flow_step1000_r16.safetensorsHigh-sigma only ( Ο β [0.55, 1.00]), DIS smooth-flowK=3, all 50 blocksMaximum sharpness & lowest chunk jump pier:sharp 2.323,chunk 0.41,f147pk 2.28Γ;panrun:chunk 1.12minimax_h3_variable_clock_k3_repeat_step1000_r16.safetensorsFull-sigma repeated-frame K=3, step 1000Tightest horizon lock on panning shots pier:dy_hf 0.111 px / dy_mx 0.23 px(3.3Γ calmer than source0.75 px);rooftop:sharp 2.265
Leaderboard Comparison Across Top Methods (1 Seed/Scene, Two-Pass handoff_sigma = 0.65, Pass 2 Pure Stock euler)
dy_hf / dy_mx = vertical horizon jitter in px (pier source 0.171 / 0.75); midSt / exSt = mid-hold / exit-ramp stutter (pier source midSt = 1.51); chunk = 17f chunk-boundary luma jump; sharp = Laplacian fine-detail ratio vs source; held_dy_hf = bamboo held-span background jitter. panrun K=3 LoRA rows use Identity-Locked SRP ([0, 2, 1]).
| Method / Stack (Pass 1 β Pure Stock Pass 2) | Extra Deps | pier dy_hf / dy_mx |
pier midSt / exSt |
pier chunk / sharp |
bamboo PSNR / held_dy_hf |
panrun chunk / stutter |
rooftop chunk / stutter |
|---|---|---|---|---|---|---|---|
Source clip (pier) |
β | 0.171 / 0.75 |
1.51 / β |
β / 1.00 |
β | β | β |
Plain K=3 Two-Pass (euler, no RYS, no SRP) |
Core only | 0.361 / 0.68 |
β | 0.36 / β |
β | β | β |
K=3 + RYS 16β32 (euler, no SRP, +run f) |
Core only | 0.103 / 0.19 |
β | 0.29 / 1.68 |
21.48 dB / 0.943 |
1.70 / 5.48 |
0.41 / 4.34 |
K=3 + RYS 20β36 (euler, no SRP, NO LoRA) |
Core only | 0.150 / 0.31 |
5.08 / 3.32 |
0.56 / 1.71 |
21.26 dBβ / 0.721β |
β | β |
K=3 + RYS 20β36 (euler, no SRP, +k3_flow_s400) |
+ K=3 LoRA |
0.110 / 0.27 |
5.25 / 3.51 |
0.53 / 1.64 |
β | β | β |
K=3 + RYS 16β32 + SRP 1.0 (NO LoRA) |
+ SRP |
0.215 / 0.59 |
1.75 / 1.64 |
0.49 / 2.06 |
19.87 dB / 0.459 |
β | 0.45 / 2.45 |
K=3 + RYS 16β32 + SRP 1.0 + Legacy run f (K=2) |
+ SRP + K=2 |
0.176 / 0.40 |
1.59 / 1.92 |
0.51 / 2.04 |
20.14 dB / 0.955 |
β | β |
K=3 + RYS 16β32 + SRP 1.0 + k3_hisigma_flow_step1000_lateattn (Best All-Around) |
+ SRP + K=3 |
0.113 / 0.36 |
2.03 / 1.63 |
0.56 / 2.17 |
19.91 dB / 0.354 |
1.14 / 4.38 |
0.95 / 2.92 |
K=3 + RYS 16β32 + SRP 1.0 + k3_flow_step400 (Smoothest Overall) |
+ SRP + K=3 |
0.341 / 0.70 |
1.48 / 1.77 |
0.58 / 2.13 |
19.89 dB / 0.348 |
1.25 / 3.30 |
0.41 / 2.73 |
K=3 + RYS 16β32 + SRP 1.0 + k3_hisigma_flow_step1000 (Sharpest / Lowest Chunk) |
+ SRP + K=3 |
0.169 / 0.47 |
2.10 / 1.91 |
0.41 / 2.32 |
19.91 dB / 0.385 |
1.12 / 6.11 |
1.03 / 3.37 |
K=3 + RYS 16β32 + SRP 1.0 + k3_repeat_step1000 (Tightest Horizon Lock) |
+ SRP + K=3 |
0.111 / 0.23 |
2.43 / 2.13 |
0.55 / 2.06 |
19.94 dB / 0.426 |
1.39 / 4.55 |
0.83 / 3.66 |
β bamboo RYS 20β36 row measured with run f (Wave 6); RYS 16β32 NO LoRA on bamboo hit 21.37 dB / 0.727.
3. Included Experimental Workflows
All three workflows live in examples/experimental/ (each with a ComfyUI UI .json and headless _api.json):
examples/experimental/stage2_derope_k3_rys_twopass.json- Dependencies: Core ComfyUI +
ComfyUI-MAINodesonly (no third-party sampler, no clock LoRA required). - Default setup:
H3Stage2Clock(K=3, RYS20-36,Ξ±=0.20,handoff_sigma=0.65) βSamplerCustomAdvancedPass 1 βSamplerCustomAdvancedPass 2 (pure stockeuler+DisableNoise). - Change the
SplitSigmasentry step to switch betweenΟ = 0.973(step = 1),Ο = 0.923(step = 2), andΟ = 0.800(step = 3) βH3Stage2Clocksplits Pass 1 and Pass 2 automatically.
- Dependencies: Core ComfyUI +
examples/experimental/stage2_derope_k3_rys_selfrefine.json- Dependencies: Core ComfyUI +
ComfyUI-MAINodes+ComfyUI-SelfRefiningSamplerPlus(no clock LoRA required). - Default setup:
SamplerSelfRefinePlus(perturb_strength_scale=1.0,l1_mean, Identity-Locked curve[[0.0, 0.0], [0.5, 1.0], [1.0, 0.5]]) βH3Stage2Clock(K=3, RYS16-32,Ξ±=0.20,handoff_sigma=0.65) β two-passeulerfinishing.
- Dependencies: Core ComfyUI +
examples/experimental/stage2_derope_k3_rys_selfrefine_lora.json(Full Champion Stack)- Dependencies: Core ComfyUI +
ComfyUI-MAINodes+ComfyUI-SelfRefiningSamplerPlus+minimax_h3_variable_clock_k3_hisigma_flow_step1000_lateattn_r16.safetensors(ork3_flow_step400). - Default setup: Loads the
K=3clock LoRA only onto Pass 1 (Pass-1 Guider) while keeping Pass 2 strictly on the stock Pika model (Pass-2 Guider,DisableNoise).
- Dependencies: Core ComfyUI +
4. Hold-Map Tips for K=3
- Keep
holduniform across17kchunk-start singletons (S(1)) and 4-frame tokens (G4): Use standardH3ManualHoldMap/H3JerkOracleramps (1 β 2 β 3 β 4 β 3 β 2 β 1). Do not forcehold = 1on every17ksingleton underK=3β that breaks the uniformworld_step / stock_stepratio againstK=3's stock Bands 0β2 and creates a 5-frame periodic stutter. - If you notice faint microstutters specifically on
hold = 2exit ramps: H3's 4-frame causal VAE decoder has a periodic 4-frame velocity wave that aliases at Nyquist underhold = 2and cancels cleanly underhold = 4. Testingramp = False(hold = 4uniform across the held span) halves exit microstutter, at the trade-off of a sharper single step at the1 β 4entry/exit seam.
5. Additional Fixes Included on This Branch
While building and testing H3Stage2Clock, three source-level bugs in motion.py were confirmed and fixed with unit tests:
- Same-length reference-video collision:
_install_true_clock_patchpreviously matched solely on token count (len(spans) == n), allowing a reference video with the same latent length as the target to inherit the target's clock. Reference blocks now stay strictly on the stock grid. - Stale
_GUIDE_LAYOUTScache:_install_guide_layout_patchnow clears_GUIDE_LAYOUTS[seq_len]when a later layout of the same sequence length carries no guide condition rows. - True Clock + DyRoPE patch-stacking crash: Patch guards now walk the
_h3_prevwrapper chain so runningH3TrueClock, thenH3DyRoPE, thenH3TrueClockagain in one ComfyUI session never double-wrapsrope_freqs.