Skip to content

EDMDPMSolverMultistepScheduler and CosineDPMSolverMultistepScheduler raise UnboundLocalError for an unknown sigma_schedule #15436

Backlog

Description

@VISHNU0906

Describe the bug

EDMDPMSolverMultistepScheduler and CosineDPMSolverMultistepScheduler don't check sigma_schedule. Any value other than "karras" or "exponential" (a typo or a capitalised "Karras") skips both branches in __init__, and the constructor fails with an UnboundLocalError about sigmas instead of saying which argument is wrong. EDMEulerScheduler, which takes the same argument, already raises a ValueError for this.

I found this while reading the scheduler code, not from a failing run. I'd like to send a small PR that adds the same check to both schedulers, with tests.

Reproduction

from diffusers import CosineDPMSolverMultistepScheduler, EDMDPMSolverMultistepScheduler, EDMEulerScheduler

for cls in (EDMEulerScheduler, EDMDPMSolverMultistepScheduler, CosineDPMSolverMultistepScheduler):
    try:
        cls(sigma_schedule="Karras")
    except Exception as e:
        print(f"{cls.__name__}: {type(e).__name__}: {e}")

Logs

EDMEulerScheduler: ValueError: Wrong value for provided for `sigma_schedule='Karras'`.`
EDMDPMSolverMultistepScheduler: UnboundLocalError: cannot access local variable 'sigmas' where it is not associated with a value
CosineDPMSolverMultistepScheduler: UnboundLocalError: cannot access local variable 'sigmas' where it is not associated with a value

System Info

  • diffusers 0.44.0.dev0 (main at 08d5de3)
  • Python 3.12.15, Linux x86_64
  • torch 2.15.0+cpu

Who can help?

@yiyixuxu

Activity

  1. kartik-911 commented on Nov 30, 2026

    @kartik-911

    Hi I want to contribute to this issue

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions