Skip to content

scheduling_cosmos25_dfd

Four-step rectified-flow ODE scheduler for the Cosmos Predict2.5 DFD student.

Classes

fastvideo.models.schedulers.scheduling_cosmos25_dfd.Cosmos25DFDScheduler

Cosmos25DFDScheduler(num_train_timesteps: int = 1000, sigma_data: float = 1.0)

Bases: SchedulerMixin, ConfigMixin, BaseScheduler

Run the fixed four-step ODE trajectory used by the public DFD checkpoint.

Source code in fastvideo/models/schedulers/scheduling_cosmos25_dfd.py
@register_to_config
def __init__(
    self,
    num_train_timesteps: int = 1000,
    sigma_data: float = 1.0,
) -> None:
    if sigma_data <= 0:
        raise ValueError(f"sigma_data must be positive, got {sigma_data}")
    self.num_train_timesteps = num_train_timesteps
    self.sigma_data = float(sigma_data)
    self.timesteps = torch.empty(0, dtype=torch.float64)
    self.sigmas = torch.empty(0, dtype=torch.float64)
    self._step_index: int | None = None
    self._begin_index: int | None = None
    BaseScheduler.__init__(self)

Methods:

fastvideo.models.schedulers.scheduling_cosmos25_dfd.Cosmos25DFDScheduler.set_shift
set_shift(shift: float) -> None

The checkpoint's learned timestep list must not be shifted.

Source code in fastvideo/models/schedulers/scheduling_cosmos25_dfd.py
def set_shift(self, shift: float) -> None:
    """The checkpoint's learned timestep list must not be shifted."""
    del shift