diff --git a/extensions_built_in/diffusion_models/minimax_h3/src/packing.py b/extensions_built_in/diffusion_models/minimax_h3/src/packing.py index 154170e5..58e56531 100644 --- a/extensions_built_in/diffusion_models/minimax_h3/src/packing.py +++ b/extensions_built_in/diffusion_models/minimax_h3/src/packing.py @@ -431,9 +431,10 @@ def remap_sigma( def build_sigma_schedule( num_inference_steps: int, shift: float = VIDEO_SIGMA_SHIFT ) -> torch.Tensor: - """The released sampling grid: linspace(1, 0, steps) through the - exponential shift, consecutive duplicates collapsed — the terminal 0 is - part of the count, so `steps` yields `steps - 1` model evaluations.""" - base = torch.linspace(1.0, 0.0, num_inference_steps, dtype=torch.float32) + """The released sampling grid: linspace(1, 0, steps + 1) through the + exponential shift, consecutive duplicates collapsed — `steps` yields + `steps` model evaluations (the released repo counts the terminal 0 in + `steps`; we don't, so sample_steps means model evals).""" + base = torch.linspace(1.0, 0.0, num_inference_steps + 1, dtype=torch.float32) sigmas = shift_sigma(base, shift) return torch.unique_consecutive(sigmas) diff --git a/extensions_built_in/diffusion_models/minimax_h3/src/pipeline.py b/extensions_built_in/diffusion_models/minimax_h3/src/pipeline.py index 2f8f871a..f0b8ab7b 100644 --- a/extensions_built_in/diffusion_models/minimax_h3/src/pipeline.py +++ b/extensions_built_in/diffusion_models/minimax_h3/src/pipeline.py @@ -9,9 +9,9 @@ exactly one transformer forward per step. ``unconditional_embeds`` and ``guidance_scale`` are accepted for harness compatibility and ignored. Scheduler (the released math, not diffusers'): - - sigma grid: ``linspace(1, 0, steps)`` through the exponential shift - (video 12, audio 3), consecutive duplicates collapsed; the terminal 0 is - part of the count so ``steps`` yields ``steps - 1`` model evaluations + - sigma grid: ``linspace(1, 0, steps + 1)`` through the exponential shift + (video 12, audio 3), consecutive duplicates collapsed; ``steps`` yields + ``steps`` model evaluations (steps = 1 is one full 1 -> 0 step) - the model consumes ``t = 1 - sigma`` (t = 1 means clean) and predicts the data-ward velocity ``clean - noise``: ``denoised = x + sigma * v`` - Euler update ``x_next = r * x + (1 - r) * denoised`` with