IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Python class

FlowMatchEulerDiscreteScheduler

FlowMatchEulerDiscreteScheduler​

class max.pipelines.diffusion.schedulers.FlowMatchEulerDiscreteScheduler(base_image_seq_len=256, max_image_seq_len=4096, base_shift=0.5, max_shift=1.15, use_flow_sigmas=False, use_dynamic_shifting=False, use_empirical_mu=False, shift_terminal=None, order=1, **unused_kwargs)

source

Bases: object

Minimal Flow Match Euler Discrete Scheduler.

This scheduler provides timestep and sigma scheduling for flow-matching diffusion models. The actual denoising step computation is handled by the pipeline (e.g., FluxPipeline._scheduler_step).

Initialize the scheduler.

Parameters:

  • base_image_seq_len (int) – Base image sequence length.
  • max_image_seq_len (int) – Maximum image sequence length.
  • base_shift (float) – Base shift.
  • max_shift (float) – Maximum shift.
  • use_flow_sigmas (bool) – Whether to use flow sigmas.
  • use_dynamic_shifting (bool) – Whether to use dynamic shifting.
  • use_empirical_mu (bool) – Whether to use empirical mu.
  • shift_terminal (float | None) – If set, stretch shifted sigmas so the last sigma equals this value instead of 1/num_steps.
  • order (int) – Order of the scheduler.
  • **unused_kwargs – Unused keyword arguments.

retrieve_timesteps_and_sigmas()​

retrieve_timesteps_and_sigmas(image_seq_len, num_inference_steps, reverse=False, sigma_min=None)

source

Retrieve timesteps and sigmas for the diffusion process.

Parameters:

  • image_seq_len (int) – Length of image sequence (H*W after packing).
  • num_inference_steps (int) – Number of inference steps.
  • reverse (bool) – Whether to reverse the timesteps and sigmas.
  • sigma_min (float | None) – Optional terminal sigma for the base schedule before shifting. If None, defaults to 1 / num_inference_steps

Returns:

Tuple of timesteps and sigmas.

Return type:

tuple[ndarray[tuple[Any, …], dtype[float32]], ndarray[tuple[Any, …], dtype[float32]]]