FlaxDDIMScheduler
Denoising Diffusion Implicit Models (DDIM) scheduler for faster sampling. Located insrc/maxdiffusion/schedulers/scheduling_ddim_flax.py:66
Configuration parameters
Number of diffusion steps used to train the model
The starting beta value of inference
The final beta value
The beta schedule, a mapping from a beta range to a sequence of betas. Options:
linear, scaled_linear, squaredcos_cap_v2Option to pass an array of betas directly to bypass beta_start/beta_end
Whether to use alpha product of 1 for the final step (vs. alpha at step 0)
An offset added to the inference steps
What the model predicts. Options:
epsilon (noise), sample (direct sample), v_predictionHow timesteps are spaced. Options:
leading, trailingMethods
create_state
Creates the scheduler state.
Returns:
Initialized scheduler state
set_timesteps
Sets the discrete timesteps for the diffusion chain.
Parameters:
Current scheduler state
Number of diffusion steps for inference
Updated scheduler state with timesteps
step
Performs one denoising step.
Parameters:
Current scheduler state
Direct output from learned diffusion model
Current discrete timestep in the diffusion chain
Current instance of sample being created
Weight of noise for added noise in diffusion step
Sample at previous timestep
Updated scheduler state
FlaxFlowMatchScheduler
Flow matching scheduler for continuous-time diffusion, used in WAN models. Located insrc/maxdiffusion/schedulers/scheduling_flow_match_flax.py:70
Configuration parameters
Number of training timesteps
Shift parameter for flow matching (typically 3.0 for 480p, 5.0 for 720p)
Maximum sigma value
Minimum sigma value
Whether to use inverse timesteps
Whether to add an extra step
Whether to reverse the sigma schedule
Methods
set_timesteps
Sets timesteps with optional time shifting.
Parameters:
Current scheduler state
Number of diffusion steps
Strength of denoising process
Whether the scheduler is being used for training
Optional shift value to override config
Updated scheduler state
step
Performs one flow matching step.
Parameters:
Current scheduler state
Model predicted velocity
Current timestep
Current sample
Whether this is the final step
Sample at previous timestep
Updated scheduler state
add_noise
Adds noise to samples according to the flow matching schedule.
Parameters:
Current scheduler state
Original clean samples
Noise to add
Timesteps corresponding to noise levels
Noisy samples
Other schedulers
MaxDiffusion also supports:FlaxEulerDiscreteScheduler
Euler discrete scheduler for efficient sampling.FlaxUniPCMultistepScheduler
UniPC multistep scheduler for fast high-quality sampling, used in WAN models.FlaxDPMSolverMultistepScheduler
DPM-Solver++ for fast sampling with fewer steps.FlaxLMSDiscreteScheduler
Linear multistep scheduler.FlaxPNDMScheduler
Pseudo numerical methods for diffusion models.Example: Using a scheduler
Scheduler selection guide
- DDIM: Fast sampling with deterministic results
- Euler: Simple and efficient, good default choice
- DPM-Solver++: Highest quality in fewest steps
- Flow matching: For continuous-time models like WAN
- UniPC: Fast convergence for video models
FlaxRectifiedFlowScheduler
Rectified flow scheduler for continuous normalizing flows, used in LTX-Video models. Provides multistep sampling with configurable shift parameters for optimal video generation quality. Located insrc/maxdiffusion/schedulers/scheduling_rectified_flow.py