mstar.model.lingbot_world.components.schedule#
The causal-fast sampling schedule, ported exactly from the reference.
Provenance: the step picks and re-noising loop follow LingBot-World v1’s
WanI2VFast.generate (Robbyant/lingbot-world, Apache-2.0);
FlowUniPCMultistepScheduler’s shifted sigmas are Wan-Video/Wan2.1’s
(Apache-2.0). The step indices and shift are the V2 1.3B checkpoint’s settings
(config.py).
The reference builds a FlowUniPCMultistepScheduler (shift 1), calls
set_timesteps(1000, shift=shift) and picks four entries by index. It never
calls the solver’s step: each step converts the flow prediction to x0 and,
except after the last step, re-noises x0 to the next timestep with
add_noise. The tables below are built with the same numpy/torch ops, so the
sigmas and int64 timesteps are bit-identical.
The int64 truncation makes neighbouring timesteps collide (about 0.3 timestep
per index near t=1000 at shift 5), and the two lookups resolve a collision
differently: the x0 conversion takes the FIRST match (argmin), add_noise
the SECOND (index_for_timestep’s pos = 1). Both are kept as is.
Functions
|
|
|
x0 = x_t - sigma_t * flow, in float64, cast back to the prediction's dtype. |
|
Classes
|
- class mstar.model.lingbot_world.components.schedule.FastSchedule(sigmas: torch.Tensor, timesteps: torch.Tensor, step_timesteps: tuple[torch.Tensor, ...])[source]#
Bases:
object
- mstar.model.lingbot_world.components.schedule.add_noise(x0, noise, timestep, schedule)[source]#
(1 - sigma) * x0 + sigma * noiseat the sample’s dtype.- Parameters:
x0 (Tensor)
noise (Tensor)
timestep (Tensor)
schedule (FastSchedule)
- Return type: