larryvrh commited on
Commit
277b82e
Β·
verified Β·
1 Parent(s): 024afb2

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +57 -63
README.md CHANGED
@@ -7,6 +7,7 @@ tags:
7
  - audio-video
8
  - lora
9
  - minimax-h3
 
10
  pipeline_tag: text-to-video
11
  ---
12
 
@@ -16,63 +17,63 @@ A LoRA for [MiniMax-H3](https://huggingface.co/Comfy-Org/MiniMax-H3) that render
16
  joint **video + synchronized stereo audio** in **4 sampling steps** instead of
17
  the usual ~20 β€” roughly a 5Γ— speedup in sampling wall-clock.
18
 
19
- > ⚠️ **This is a demo / preview checkpoint, not a finished model.** It is an
20
- > early snapshot from an in-progress run β€” under-trained, the time-averaged
21
- > (EMA) variant hasn't matured, and overall quality is **nowhere near what a
22
- > full run will produce**. What it *does* already show is a clear improvement
23
- > over the base model at 4 steps: sharper detail and cleaner, better-synced
24
- > audio than the base gives you in the same 4 steps. Treat it as a taste of the
25
- > direction, not the destination. No comfyui support yet, will add later.
26
-
27
- > If you get completely broken audio after loading this in ComfyUI, it's almost
28
- > certainly a scheduler mismatch. With the correct sampler the audio here is a bit
29
- > rough but coherent (this is an early preview checkpoint); *completely* broken β€”
30
- > blown-out, distorted, or noise-like audio β€” is the signature of the wrong sampler.
31
- > MiniMax-H3 runs video and audio on two different flow schedules (shift 12 for
32
- > video, 3 for audio). The model returns the audio velocity pre-scaled so that a
33
- > plain single-schedule ("flat") sampler β€” what ComfyUI's stock samplers do β€” can
34
- > step both streams with one schedule. That approximation holds at the usual ~20
35
- > steps, but at ultra-low step counts like 4 the flat step massively overshoots the
36
- > audio schedule on the last steps, and the audio energy explodes.
37
- > To make audio work at 4 steps you have to replace the flat single-schedule
38
- > sampler with a dual-clock one that integrates the audio stream on its own shifted
39
- > schedule (recovering the raw audio velocity by dividing the schedule derivative
40
- > back out). That is exactly what generate.py in this repo does, and it matches
41
- > MiniMax-H3's official dual-scheduler behavior.
42
-
43
-
44
- Two weight files are included:
45
-
46
- | file | notes |
47
- |---|---|
48
- | `minimax_h3_turbo_4step.safetensors` | trained weights β€” crisper, holds up better on fast motion |
49
- | `minimax_h3_turbo_4step_ema.safetensors` | time-averaged weights β€” smoother, but **immature at this checkpoint** (EMA hasn't warmed up), so it can look soft |
50
-
51
- Both are bf16, ~744 MB, apply as a standard low-rank update
52
- (`W_eff = W + lora_B @ lora_A`, alpha = rank so no extra scaling).
53
-
54
- ## Quick start
55
-
56
- The base model, VAEs and text encoder come from the official MiniMax-H3 release,
57
- and the model definitions live in ComfyUI, so you need a ComfyUI checkout:
 
 
 
 
 
58
 
59
  ```bash
60
- # 1. ComfyUI (pinned to the commit these weights were validated against)
61
  git clone https://github.com/comfyanonymous/ComfyUI
62
  cd ComfyUI && git checkout 14b05228cef127ce529bc0c08660770d4af3e9a8
63
  pip install -r requirements.txt && cd ..
 
64
 
65
- # 2. this release
66
- pip install -r requirements.txt # torch, safetensors, imageio-ffmpeg, ...
67
-
68
- # 3. base weights (from Comfy-Org/MiniMax-H3): the bf16 DiT, the int8 Qwen3-VL
69
- # text encoder, and the video + audio VAEs, into a models/ tree.
70
-
71
- # 4. generate
72
  python generate.py \
73
  --comfyui ./ComfyUI \
74
  --base models/diffusion_models/minimax_h3_fl2va_bf16.safetensors \
75
- --lora minimax_h3_turbo_4step.safetensors \
76
  --te models/text_encoders/qwen3vl_32b_minimax_h3_int8_convrot.safetensors \
77
  --video-vae models/vae/minimax_h3_video_vae_fp16.safetensors \
78
  --audio-vae models/vae/minimax_h3_audio_vae_fp32.safetensors \
@@ -80,20 +81,13 @@ python generate.py \
80
  --width 1344 --height 768 --frames 124 --out corgi.mp4
81
  ```
82
 
83
- `generate.py` is a single self-contained file: it loads the base DiT and merges
84
- the LoRA, encodes the prompt with Qwen3-VL, runs 4-step sampling on the model's
85
- native dual video/audio schedule, decodes both streams and muxes an mp4.
86
-
87
  ## Notes
88
 
89
- - **Resolution / duration**: width and height are multiples of 16 (the canvas is
90
- 32-based); the short edge is typically 768. Frame count is at 24 fps and snaps
91
- up to the model's 17Β·k+5 grid (124 β‰ˆ 5 s). The validated range is ~124–362
92
- frames (~5–15 s).
93
- - **VRAM**: the base model is large (~33 B). `--offload-adaln` keeps the biggest
94
- timestep-conditioned weights in CPU fp32, saving ~13 GB; an 80 GB GPU runs
95
- comfortably, smaller cards can try with offload on.
96
- - **Steps**: 4 is the design point. `--steps 8` is a little cleaner if you have
97
- the budget; the schedule is the same either way.
98
- - **Audio**: the model emits 32 kHz stereo aligned to the video; the two streams
99
- ride different flow schedules and `generate.py` integrates each on its own.
 
7
  - audio-video
8
  - lora
9
  - minimax-h3
10
+ - comfyui
11
  pipeline_tag: text-to-video
12
  ---
13
 
 
17
  joint **video + synchronized stereo audio** in **4 sampling steps** instead of
18
  the usual ~20 β€” roughly a 5Γ— speedup in sampling wall-clock.
19
 
20
+ > ⚠️ **Early prototype β€” the weights *and* the tooling.** These weights are an
21
+ > early, under-trained checkpoint (not production quality), and the ComfyUI nodes
22
+ > below are prototype code: **functionality and compatibility are not
23
+ > guaranteed.** It is already a clear step up from the base model at 4 steps β€”
24
+ > sharper detail, cleaner and better-synced audio β€” but treat everything here as
25
+ > a work-in-progress taste, not a finished product. **If something breaks, please
26
+ > open an issue** on the [node repo](https://github.com/Larryvrh/ComfyUI-MiniMax-H3-Turbo/issues).
27
+
28
+ ## Use it in ComfyUI (recommended)
29
+
30
+ Custom nodes: **[Larryvrh/ComfyUI-MiniMax-H3-Turbo](https://github.com/Larryvrh/ComfyUI-MiniMax-H3-Turbo)**
31
+ β€” or search **"MiniMax-H3 Turbo"** in ComfyUI-Manager.
32
+
33
+ 1. Install the nodes (Manager, or `git clone` into `ComfyUI/custom_nodes`).
34
+ 2. Download a `.safetensors` from this repo into `ComfyUI/models/loras/`.
35
+ 3. Start from the official [MiniMax-H3 workflow](https://docs.comfy.org/tutorials/video/minimax/minimax-h3)
36
+ (text-to-video or image-to-video) and make two changes:
37
+ - insert **MiniMax-H3 Turbo LoRA** between the model loader and the sampler;
38
+ - replace the sampler feeding `SamplerCustomAdvanced` with **MiniMax-H3 Turbo
39
+ Sampler (4-step)**, and set the scheduler to **4 steps** (`simple`).
40
+
41
+ Everything else stays as in the official workflow, so both t2v and i2v work.
42
+ The custom sampler is required: MiniMax-H3 runs video and audio on two different
43
+ flow schedules, and a stock sampler over-steps the audio at 4 steps and it breaks.
44
+
45
+ ## Weights
46
+
47
+ Three checkpoints, all bf16, ~744 MB, applied as a standard low-rank update
48
+ (`W_eff = W + lora_B @ lora_A`, alpha = rank so no extra scaling):
49
+
50
+ | file | ~steps | notes |
51
+ |---|---|---|
52
+ | `minimax_h3_turbo_4step_ema_ckpt500.safetensors` | ~500 | **newest, most-trained β€” recommended default** (time-averaged) |
53
+ | `minimax_h3_turbo_4step.safetensors` | ~200 | initial release, trained weights β€” a bit sharper on very fast motion |
54
+ | `minimax_h3_turbo_4step_ema.safetensors` | ~200 | initial release, time-averaged β€” softer; superseded by the ckpt500 file |
55
+
56
+ Training is ongoing; newer checkpoints will land here over time.
57
+
58
+ ## Standalone (no ComfyUI graph)
59
+
60
+ `generate.py` is a single self-contained file β€” loads the base DiT + a LoRA,
61
+ encodes the prompt, runs the 4-step dual-schedule sampler, decodes and muxes an
62
+ mp4. It still needs a ComfyUI checkout for the H3 model / VAE / text-encoder
63
+ definitions:
64
 
65
  ```bash
66
+ # ComfyUI (pinned to the commit these weights were validated against)
67
  git clone https://github.com/comfyanonymous/ComfyUI
68
  cd ComfyUI && git checkout 14b05228cef127ce529bc0c08660770d4af3e9a8
69
  pip install -r requirements.txt && cd ..
70
+ pip install -r requirements.txt # this repo: torch, safetensors, imageio-ffmpeg
71
 
72
+ # base weights from Comfy-Org/MiniMax-H3 into a models/ tree, then:
 
 
 
 
 
 
73
  python generate.py \
74
  --comfyui ./ComfyUI \
75
  --base models/diffusion_models/minimax_h3_fl2va_bf16.safetensors \
76
+ --lora minimax_h3_turbo_4step_ema_ckpt500.safetensors \
77
  --te models/text_encoders/qwen3vl_32b_minimax_h3_int8_convrot.safetensors \
78
  --video-vae models/vae/minimax_h3_video_vae_fp16.safetensors \
79
  --audio-vae models/vae/minimax_h3_audio_vae_fp32.safetensors \
 
81
  --width 1344 --height 768 --frames 124 --out corgi.mp4
82
  ```
83
 
 
 
 
 
84
  ## Notes
85
 
86
+ - **Resolution / duration**: width/height are multiples of 32; the short edge is
87
+ typically 768. Frame count is at 24 fps and snaps to the model's 17Β·k+5 grid
88
+ (124 β‰ˆ 5 s). Validated range ~124–362 frames (~5–15 s).
89
+ - **VRAM**: the base model is large (~33 B); an 80 GB GPU is comfortable
90
+ (`--offload-adaln` in the standalone script trades ~13 GB of VRAM for CPU RAM).
91
+ - **Steps**: 4 is the design point, scheduler `simple`.
92
+ - **Audio**: 32 kHz stereo, aligned to the video; the two streams ride different
93
+ flow schedules and are integrated each on its own clock.