Skip to content

fix(schedulers): preserve float32 timesteps when use_flow_sigmas=True - #15192

Open
Vuln3rat0r wants to merge 1 commit into
huggingface:mainfrom
Vuln3rat0r:fix-flow-sigmas-continuous-timesteps
Open

Vuln3rat0r wants to merge 1 commit into
huggingface:mainfrom
Vuln3rat0r:fix-flow-sigmas-continuous-timesteps

Conversation

@Vuln3rat0r

Copy link
Copy Markdown

Summary

Fixes #15167.

When use_flow_sigmas=True, multistep schedulers previously cast self.timesteps to torch.int64, truncating continuous flow-matching timesteps into integer values. Continuous flow models (such as FLUX.1, SD3.5, Wan2.1, and Cosmos) require floating-point timesteps to integrate along continuous trajectories without truncation artifacts.

This change preserves torch.float32 timesteps when self.config.use_flow_sigmas=True, and preserves torch.int64 for discrete diffusion schedulers (use_flow_sigmas=False).

Schedulers updated:

  • UniPCMultistepScheduler
  • DPMSolverMultistepScheduler
  • DPMSolverSinglestepScheduler
  • DPMSolverMultistepInverseScheduler
  • DEISMultistepScheduler
  • SASolverScheduler

Testing

  • Added test_flow_sigmas_continuous_timesteps across all updated scheduler test suites to verify torch.float32 timestep retention and end-to-end integration step execution.
  • Updated Cosmos 3 pipeline test assertions to match continuous timestep values.
  • Verified all scheduler test suites and code formatting passes (ruff check, ruff format --check).

Reviewers

@yiyixuxu @dg845

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UniPC and DPM-Solver with use_flow_sigmas condition the model on integer timesteps while integrating with float sigmas

1 participant