Adjust sample timestep sigmas to be model evals for h3 for 1 extra step

This commit is contained in:
Jaret Burkett 2026-08-06 19:54:04 -06:00
parent 9171d5ec1d
commit 685ce37a8d
2 changed files with 8 additions and 7 deletions

View File

@ -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)

View File

@ -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