Image-Text-to-Video
Diffusers
Safetensors
MiniMax H3
modular-diffusers
ref2va
fl2va
Merge
synchronized-audio-video
experimental
Instructions to use diffusers-modular/MiniMax-H3-Pruned-Ref-Delta-Fused-r1024 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use diffusers-modular/MiniMax-H3-Pruned-Ref-Delta-Fused-r1024 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("diffusers-modular/MiniMax-H3-Pruned-Ref-Delta-Fused-r1024", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Explain that keyframes and references can share one generation, and what that needs
Browse files
README.md
CHANGED
|
@@ -39,7 +39,8 @@ for reference conditioning. This is **one** checkpoint that serves both, so a de
|
|
| 39 |
|
| 40 |
## Inference
|
| 41 |
|
| 42 |
-
Both workflows resolve to the weights in this repo, and each loads only its own slot
|
|
|
|
| 43 |
|
| 44 |
```python
|
| 45 |
import torch
|
|
@@ -81,8 +82,27 @@ out = pipe( # same repo, reloaded with workflow="fl2va"
|
|
| 81 |
video, audio, rate = out["videos"][0], out["audio"][0], out["sampling_rate"]
|
| 82 |
```
|
| 83 |
|
| 84 |
-
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
### Few-step generation — keep the turbo LoRA live
|
| 88 |
|
|
@@ -114,6 +134,8 @@ ships a `MiniMaxH3PrunedTransformer3DModel` whose AdaLN is 8 wide, where the sto
|
|
| 114 |
5. **Keep the AdaLN affine map.** `adaln_basis` / `adaln_mean` ship as buffers, so LoRAs trained on the released
|
| 115 |
2688-wide AdaLN still project onto this 8-wide one.
|
| 116 |
|
|
|
|
|
|
|
| 117 |
|
| 118 |
## Measured
|
| 119 |
|
|
|
|
| 39 |
|
| 40 |
## Inference
|
| 41 |
|
| 42 |
+
Both workflows resolve to the weights in this repo, and each loads only its own slot — pass a `workflow=`, or the
|
| 43 |
+
components of *both* transformer slots get pulled:
|
| 44 |
|
| 45 |
```python
|
| 46 |
import torch
|
|
|
|
| 82 |
video, audio, rate = out["videos"][0], out["audio"][0], out["sampling_rate"]
|
| 83 |
```
|
| 84 |
|
| 85 |
+
### Keyframes and references in the same generation
|
| 86 |
+
|
| 87 |
+
The model itself supports it — MiniMax-H3 denoises one packed sequence, and keyframe conditioning rows and reference
|
| 88 |
+
conditioning rows can both sit in it. ComfyUI exposes this natively: chain its `MiniMaxH3ReferenceToVideo` into
|
| 89 |
+
`MiniMaxH3AddGuide` and one sampler run carries both.
|
| 90 |
+
|
| 91 |
+
`diffusers` does **not** expose it. Its auto-blocks dispatch either/or — `select_block` checks `references` first and
|
| 92 |
+
returns the `ref2va` branch — so a request carrying both is accepted and the **keyframes are silently dropped**. There
|
| 93 |
+
is no error and no warning; you get a reference-only generation.
|
| 94 |
+
|
| 95 |
+
Combining them therefore needs one extra piece on top of `diffusers`: a layout step that packs
|
| 96 |
+
`[text | keyframe conditions | reference blocks | targets]` into one sequence, with the keyframe anchors shifted by
|
| 97 |
+
the references' total time span (the references push the target timeline out). Porting
|
| 98 |
+
[ComfyUI's `PackedLayout`](https://github.com/comfyanonymous/ComfyUI/blob/master/comfy/ldm/minimax/model.py) is the
|
| 99 |
+
straightforward way to get it, and the denoising loop needs no change at all, since the conditioning rows are simply
|
| 100 |
+
the leading rows of the sequence.
|
| 101 |
+
|
| 102 |
+
Measured on this checkpoint with such a layout in place: a combined request (first frame + last frame + an image
|
| 103 |
+
reference) agrees with the real `ref2va` partition at video-latent cosine **0.972** — closer than any reference-only
|
| 104 |
+
request reaches, because keyframes anchoring both ends leave the delta less to carry. Adding an audio reference on top
|
| 105 |
+
moves the video only 0.965 while rewriting the soundtrack to 0.403, i.e. each conditioning does its own job.
|
| 106 |
|
| 107 |
### Few-step generation — keep the turbo LoRA live
|
| 108 |
|
|
|
|
| 134 |
5. **Keep the AdaLN affine map.** `adaln_basis` / `adaln_mean` ship as buffers, so LoRAs trained on the released
|
| 135 |
2688-wide AdaLN still project onto this 8-wide one.
|
| 136 |
|
| 137 |
+
Verified by re-downloading this repo and generating: bit-identical (`torch.equal` on video and audio latents) to the
|
| 138 |
+
local build it was made from.
|
| 139 |
|
| 140 |
## Measured
|
| 141 |
|