Skip to content

Validate sigma_schedule in EDMDPMSolver and CosineDPMSolver schedulers - #15506

Open
kartik-911 wants to merge 1 commit into
huggingface:mainfrom
kartik-911:fix-edm-sigma-schedule-validation
Open

kartik-911 wants to merge 1 commit into
huggingface:mainfrom
kartik-911:fix-edm-sigma-schedule-validation

Conversation

@kartik-911

Copy link
Copy Markdown

What does this PR do?

EDMDPMSolverMultistepScheduler and CosineDPMSolverMultistepScheduler don't validate sigma_schedule. Any value other than "karras" or "exponential" (e.g. a typo or "Karras") skips both branches in __init__ and fails with an unhelpful UnboundLocalError about sigmas.

EDMEulerScheduler already raises a ValueError for this. This PR adds the same kind of check to the other two schedulers, with tests.

Before:
EDMDPMSolverMultistepScheduler: UnboundLocalError: cannot access local variable 'sigmas' ...
CosineDPMSolverMultistepScheduler: UnboundLocalError: cannot access local variable 'sigmas' ...

After:
EDMDPMSolverMultistepScheduler: ValueError: sigma_schedule must be 'karras' or 'exponential', but got 'Karras'.
CosineDPMSolverMultistepScheduler: ValueError: sigma_schedule must be 'karras' or 'exponential', but got 'Karras'.

Fixes #15436

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EDMDPMSolverMultistepScheduler and CosineDPMSolverMultistepScheduler raise UnboundLocalError for an unknown sigma_schedule

1 participant