Diffusers documentation
MiniMaxH3Scheduler
MiniMaxH3Scheduler
MiniMaxH3Scheduler is the rectified-flow Euler scheduler (eta = 0) with an exponential sigma shift used by MiniMax-H3, sigma' = s * sigma / (1 + (s - 1) * sigma).
The MiniMax-H3 pipelines register two of them, because video and audio latents step down two different schedules inside a single transformer call per step: scheduler carries the video schedule (shift=12.0 in the released checkpoints) and audio_scheduler the audio one (shift=3.0).
MiniMaxH3Scheduler
class diffusers.MiniMaxH3Scheduler
< source >( shift: float = 12.0 )
Rectified-flow Euler scheduler (eta = 0) with an exponential sigma shift, as used by MiniMax-H3.
index_for_timestep
< source >( timestep: typing.Union[float, torch.Tensor] ) → int
Map a timestep value to its index in the schedule.
scale_noise
< source >( sample: FloatTensortimestep: typing.Union[float, torch.FloatTensor]noise: FloatTensor ) → torch.FloatTensor
Rectified-flow forward process, in MiniMax-H3’s t convention: x_t = t*x_0 + (1 - t)*noise.
MiniMax-H3 uses this to noise its conditioning anchors, where t is the noise_aug level rather than a
schedule entry, so timestep is taken at face value and is not looked up in self.timesteps.
set_begin_index
< source >( begin_index: int = 0 )
Sets the begin index for the scheduler.
set_shift
< source >( shift: float )
Overrides the configured sigma shift; call before set_timesteps().
MiniMax-H3 exposes this per request as flow_shift (video) / audio_flow_shift (audio).
set_timesteps
< source >( num_inference_steps: int | None = Nonedevice: typing.Union[str, torch.device, NoneType] = Nonesigmas: typing.Union[list[float], torch.Tensor, NoneType] = None )
Parameters
- num_inference_steps (
int, optional) — Number of sigma grid points, terminal0included. Ignored whensigmasis given. - device (
strortorch.device, optional) — Device the schedule tensors are moved to. The grid itself is always built on CPU in float32 so the schedule does not depend on the accelerator. - sigmas (
list[float]ortorch.Tensor, optional) — A fully-formed sigma schedule, used verbatim (no shifting, no deduplication). It must be strictly decreasing and terminate at0.0.
Build the sigma / timestep schedule.
The grid is linspace(1, 0, num_inference_steps) pushed through the exponential shift, with consecutive
duplicates collapsed. The terminal 0 is already part of that grid — the shift maps 0 to exactly 0 — so
the schedule holds num_inference_steps sigmas and drives num_inference_steps - 1 model evaluations, exposed
as self.timesteps = 1 - sigmas[:-1].
step
< source >( model_output: FloatTensortimestep: typing.Union[float, torch.FloatTensor]sample: FloatTensorreturn_dict: bool = True ) → MiniMaxH3SchedulerOutput or tuple
Parameters
- model_output (
torch.FloatTensor) — The transformer’s velocity prediction attimestep. - timestep (
floatortorch.FloatTensor) — The current timestep, one ofself.timesteps(sotimestep == 1 - sigma). - sample (
torch.FloatTensor) — The current samplex_t. - return_dict (
bool, defaults toTrue) — Whether to return aMiniMaxH3SchedulerOutputinstead of a plain tuple.
Returns
MiniMaxH3SchedulerOutput or tuple
the sample for the next step.
Take one Euler (eta = 0) step.
The model output is a data-ward velocity, so the denoised estimate is x0 = x_t + (1 - t) * v — note the +,
the opposite of the usual flow-match convention. The update is then the blend x_next = r*x_t + (1 - r)*x0 with r = sigma_next / sigma, evaluated in float32 for half-precision samples.
MiniMaxH3SchedulerOutput
class diffusers.schedulers.scheduling_minimax_h3.MiniMaxH3SchedulerOutput
< source >( prev_sample: FloatTensor )
Output class for the scheduler’s step function output.