Spaces:
Running on Zero
Running on Zero
Download h3_split_blocks.py from FastVideo/fastvideo-fasth3-preview: direct link, hf CLI and curl.
- Browser
- Download file 2.39 kB
-
https://huggingface.co/spaces/FastVideo/fastvideo-fasth3-preview/resolve/refs%2Fpr%2F2/h3_split_blocks.py
- Command line
-
hf download hf://spaces/FastVideo/fastvideo-fasth3-preview@refs/pr/2/h3_split_blocks.py
-
curl -L -o h3_split_blocks.py https://huggingface.co/spaces/FastVideo/fastvideo-fasth3-preview/resolve/refs%2Fpr%2F2/h3_split_blocks.py
2.39 kB
| """The denoising half of a **split** MiniMax-H3 deployment. | |
| MiniMax-H3 is ~196 GiB in bfloat16 and a ZeroGPU Space is evicted at 150 GB of storage, so `MiniMaxH3Blocks` is cut | |
| at its `text_encoder` step: the 62.14 GiB Qwen3-VL conditioner runs in its own Space and everything else — the | |
| distilled transformer and the two autoencoders — runs here. `prompt_embeds` + `text_token_tags` is the whole wire | |
| format between the two halves. | |
| Dropping the `text_encoder` step drops the three components it declares, so `load_components` resolves | |
| `transformer` / `vae` / `audio_vae` / the two schedulers out of the checkpoint's `modular_model_index.json` and never | |
| fetches the conditioner. | |
| `resize` runs on **both** sides: it owns no pretrained component (PIL and arithmetic), and each half needs the canvas | |
| — the conditioner to build its vision blocks, this half to lay out the latents. The caller aligns the frame count to | |
| `17 * n + 5` before the call. | |
| Adapted from `multimodalart/minimax-h3`, trimmed to the `t2va` (text → video + audio) branch this Space serves. | |
| """ | |
| from diffusers.modular_pipelines.minimax_h3.decoders import MiniMaxH3AfterDenoiseStep | |
| from diffusers.modular_pipelines.minimax_h3.modular_blocks_minimax_h3 import ( | |
| MiniMaxH3AutoKeyframeVaeEncoderStep, | |
| MiniMaxH3AutoResizeStep, | |
| MiniMaxH3CoreDenoiseStep, | |
| MiniMaxH3DecodeStep, | |
| _generation_outputs, | |
| ) | |
| from diffusers.modular_pipelines.modular_pipeline import SequentialPipelineBlocks | |
| class MiniMaxH3GeneratorBlocks(SequentialPipelineBlocks): | |
| """The denoising half of a split MiniMax-H3: `MiniMaxH3Blocks` with its `text_encoder` step removed.""" | |
| model_name = "minimax-h3" | |
| block_classes = [ | |
| MiniMaxH3AutoResizeStep, | |
| MiniMaxH3AutoKeyframeVaeEncoderStep, | |
| MiniMaxH3CoreDenoiseStep, | |
| MiniMaxH3AfterDenoiseStep, | |
| MiniMaxH3DecodeStep, | |
| ] | |
| block_names = ["resize", "vae_encoder", "denoise", "after_denoise", "decode"] | |
| def description(self): | |
| return ( | |
| "The denoising half of a split MiniMax-H3 deployment: the `t2va` branch of `MiniMaxH3Blocks` without its " | |
| "text-encoder step, so `prompt_embeds` and `text_token_tags` come in as inputs and the 62.14 GiB Qwen3-VL " | |
| "conditioner is never loaded here." | |
| ) | |
| def outputs(self): | |
| return _generation_outputs() | |