reference ¶
MiniMax H3 reference inputs and media preparation helpers.
Classes¶
fastvideo.pipelines.basic.minimax_h3.reference.MiniMaxH3PreparedReference dataclass ¶
MiniMaxH3PreparedReference(media_type: Literal['image', 'video', 'audio'], has_audio: bool = False, image: Image | None = None, frames: ndarray | None = None, waveform: Tensor | None = None, block_timestamps: list[float] = list(), num_latent_frames: int = 1, latent_height: int = 0, latent_width: int = 0, num_audio_latents: int = 0)
Decoded Ref2VA media and the latent geometry resolved by condition encoding.
fastvideo.pipelines.basic.minimax_h3.reference.MiniMaxH3Reference dataclass ¶
MiniMaxH3Reference(source: Any, media_type: Literal['image', 'video', 'audio'] = 'image', soundtrack: Any | None = None, fps: float | None = None, sample_rate: int | None = None)
One ordered Ref2VA input; decoding is deferred until request preparation.
Functions:¶
fastvideo.pipelines.basic.minimax_h3.reference.decode_reference_audio ¶
Decode the first audio stream without imposing H3's target sample rate.
Source code in fastvideo/pipelines/basic/minimax_h3/reference.py
fastvideo.pipelines.basic.minimax_h3.reference.decode_reference_video ¶
decode_reference_video(source: str | PathLike[str]) -> tuple[ndarray, float, tuple[Tensor, int] | None]
Decode RGB frames, display rotation, frame rate, and an optional soundtrack.
Source code in fastvideo/pipelines/basic/minimax_h3/reference.py
fastvideo.pipelines.basic.minimax_h3.reference.prepare_reference ¶
prepare_reference(reference: MiniMaxH3Reference, num_frames: int, target_sample_rate: int) -> MiniMaxH3PreparedReference
Decode and normalize one deferred Ref2VA medium.
Source code in fastvideo/pipelines/basic/minimax_h3/reference.py
fastvideo.pipelines.basic.minimax_h3.reference.prepare_reference_frames ¶
prepare_reference_frames(frames: ndarray, num_frames: int) -> ndarray
Trim a reference video to the request and resize every RGB frame.
Source code in fastvideo/pipelines/basic/minimax_h3/reference.py
fastvideo.pipelines.basic.minimax_h3.reference.prepare_reference_image ¶
Resize an RGB reference image to its resolved condition canvas.
Source code in fastvideo/pipelines/basic/minimax_h3/reference.py
fastvideo.pipelines.basic.minimax_h3.reference.prepare_reference_waveform ¶
prepare_reference_waveform(waveform: Tensor, sample_rate: int, target_sample_rate: int, max_duration: float) -> Tensor
Normalize reference audio to stereo float32 at the audio-VAE rate.
Source code in fastvideo/pipelines/basic/minimax_h3/reference.py
fastvideo.pipelines.basic.minimax_h3.reference.reference_media_to_uint8 ¶
reference_media_to_uint8(media: Any) -> ndarray
Normalize PIL, tensor, NumPy, or frame-list media to channel-last uint8.
Source code in fastvideo/pipelines/basic/minimax_h3/reference.py
fastvideo.pipelines.basic.minimax_h3.reference.resample_reference_frames ¶
resample_reference_frames(frames: ndarray, fps: float) -> ndarray
Nearest-resample reference frames onto H3's fixed 24-fps timeline.
Source code in fastvideo/pipelines/basic/minimax_h3/reference.py
fastvideo.pipelines.basic.minimax_h3.reference.resolve_reference_image_size ¶
Resolve the released 2048-short-edge reference-image canvas.
Source code in fastvideo/pipelines/basic/minimax_h3/reference.py
fastvideo.pipelines.basic.minimax_h3.reference.sample_reference_video_frames ¶
Sample the released 2-fps Qwen presentation and its block timestamps.
Source code in fastvideo/pipelines/basic/minimax_h3/reference.py
fastvideo.pipelines.basic.minimax_h3.reference.trim_reference_num_frames ¶
Trim video references to the causal VAE's complete chunk geometry.
Source code in fastvideo/pipelines/basic/minimax_h3/reference.py
fastvideo.pipelines.basic.minimax_h3.reference.validate_references ¶
validate_references(references: list[Any]) -> list[MiniMaxH3Reference]
Validate the ordered Ref2VA media list and its per-modality limits.