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
Document the combined workflow shipped in this repo
Browse files
README.md
CHANGED
|
@@ -84,25 +84,42 @@ video, audio, rate = out["videos"][0], out["audio"][0], out["sampling_rate"]
|
|
| 84 |
|
| 85 |
### Keyframes and references in the same generation
|
| 86 |
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
`
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
### Few-step generation β keep the turbo LoRA live
|
| 108 |
|
|
@@ -167,4 +184,5 @@ approach established by [Kijai](https://huggingface.co/Kijai/MiniMax-H3-experime
|
|
| 167 |
[MiniMaxAI](https://huggingface.co/MiniMaxAI/MiniMax-H3). Related community work on the same question:
|
| 168 |
[lihaoyun6](https://huggingface.co/lihaoyun6/MiniMax-H3-Ref-Patch) (exact-diff-only patch),
|
| 169 |
[smhfacct](https://huggingface.co/smhfacct/Minimax-H3-fl2va-ref2va-hybrid-models) (AdaLN block swap),
|
| 170 |
-
[PulpCut](https://huggingface.co/PulpCut/MiniMax-H3-Ref2VA-Turbo-INT8-ConvRot) (turbo merged into Ref2VA).
|
|
|
|
|
|
| 84 |
|
| 85 |
### Keyframes and references in the same generation
|
| 86 |
|
| 87 |
+
`workflow="combined"` β this repo ships the blocks for it:
|
| 88 |
+
|
| 89 |
+
```python
|
| 90 |
+
pipe = ModularPipeline.from_pretrained(REPO, workflow="combined", trust_remote_code=True)
|
| 91 |
+
pipe.load_components(dtype=torch.bfloat16, trust_remote_code=True)
|
| 92 |
+
|
| 93 |
+
out = pipe(
|
| 94 |
+
prompt="She lifts the teacup and takes a slow sip, then smiles; warm kitchen light",
|
| 95 |
+
references=[MiniMaxH3ImageReference.from_file("subject.png")], # who / what
|
| 96 |
+
image=Image.open("first.png"), last_image=Image.open("last.png"), # where it starts and ends
|
| 97 |
+
height=544, width=960, num_frames=124, num_inference_steps=20,
|
| 98 |
+
generator=torch.Generator("cpu").manual_seed(42),
|
| 99 |
+
)
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
MiniMax-H3 denoises **one packed sequence**, and that sequence can hold keyframe conditioning rows and reference
|
| 103 |
+
conditioning rows at the same time. `diffusers`' shipped blocks cannot express it: their conditional steps dispatch
|
| 104 |
+
either/or β `select_block` checks `references` first β so a request carrying both is accepted and the **keyframes are
|
| 105 |
+
silently dropped**, with no error and no warning.
|
| 106 |
+
|
| 107 |
+
`MiniMaxH3CombinedBlocks` (in `combined_blocks.py`) is the stock blockset with three of its conditional steps replaced
|
| 108 |
+
by ones that know a fourth shape. It reserves `[text | keyframe conditions | reference blocks | target audio | target
|
| 109 |
+
video]`, and because the references push the target timeline out, the keyframe anchors ride on the timeline their
|
| 110 |
+
spans leave behind. The `t2va`, `fl2va` and `ref2va` workflows are untouched and take exactly the same path as before;
|
| 111 |
+
the denoising loop needed no change at all, since the conditioning rows are simply the leading rows of the sequence.
|
| 112 |
+
|
| 113 |
+
Two things keep it honest: the layout reproduces **both** shipped `diffusers` builders bit for bit in their degenerate
|
| 114 |
+
cases β no keyframes gives the `ref2va` layout, no references gives the `fl2va` one, `position_ids` compared in
|
| 115 |
+
float64 β and the stock prepare-latents step asserts that the conditioning rows encoded equal the rows the layout
|
| 116 |
+
reserved, so a wrong layout raises instead of quietly degrading.
|
| 117 |
+
|
| 118 |
+
Measured on this checkpoint β with this layout, driven through the same underlying steps, before it was packaged as
|
| 119 |
+
the blockset above: a combined request (first frame + last frame + an image reference) agrees with the real
|
| 120 |
+
`ref2va` partition at video-latent cosine **0.972**, closer than any reference-only request reaches, because keyframes
|
| 121 |
+
anchoring both ends leave the delta less to carry. Adding an audio reference on top moves the video only 0.965 while
|
| 122 |
+
rewriting the soundtrack to 0.403 β each conditioning doing its own job.
|
| 123 |
|
| 124 |
### Few-step generation β keep the turbo LoRA live
|
| 125 |
|
|
|
|
| 184 |
[MiniMaxAI](https://huggingface.co/MiniMaxAI/MiniMax-H3). Related community work on the same question:
|
| 185 |
[lihaoyun6](https://huggingface.co/lihaoyun6/MiniMax-H3-Ref-Patch) (exact-diff-only patch),
|
| 186 |
[smhfacct](https://huggingface.co/smhfacct/Minimax-H3-fl2va-ref2va-hybrid-models) (AdaLN block swap),
|
| 187 |
+
[PulpCut](https://huggingface.co/PulpCut/MiniMax-H3-Ref2VA-Turbo-INT8-ConvRot) (turbo merged into Ref2VA). The
|
| 188 |
+
packed-sequence order a combined request uses follows ComfyUI's implementation of this model.
|