fastvideo-fasth3-preview / h3_split_blocks.py
multimodalart's picture
multimodalart HF Staff
FastH3 Preview: 4-step MiniMax-H3 T2VA, split conditioner
7a2067c verified
Raw History Blame
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"]
@property
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."
)
@property
def outputs(self):
return _generation_outputs()