EDMDPMSolverMultistepScheduler and CosineDPMSolverMultistepScheduler raise UnboundLocalError for an unknown sigma_schedule
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- machine-learning
Research direction
Read the constructors for EDMDPMSolverMultistepScheduler and CosineDPMSolverMultistepScheduler, then compare their sigma_schedule validation with EDMEulerScheduler. Add tests for an unsupported value such as "Karras" and confirm both constructors raise ValueError with a useful message.
Written by the indexing model from the issue text.
Description
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 08d5de30e)
- Python 3.12.15, Linux x86_64
- torch 2.15.0+cpu
Who can help?
@yiyixuxu
- Dominant language
- Python
- Stars
- 35k
- Forks
- 7.5k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 58
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from huggingface/diffusers
-
InpaintProcessor crashes when padding_mask_crop is set and a dimension is omittedPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
huggingface/diffusers#15433 ·
Maintainers usually reply within 1 day
-
LTXEulerAncestralRFScheduler skips signal scaling with s_noise=0Possibly taken @hparik11 claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
huggingface/diffusers#15423 · 2 comments ·
Maintainers usually reply within 1 day
-
Docs: 13 docstrings document parameters their functions don't havePossibly taken @M-Colley claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
huggingface/diffusers#15363 · 2 comments ·
Maintainers usually reply within 1 day
-
`ZImageImg2ImgPipeline` / `ZImageInpaintPipeline`: explicit height/width different from the input image raises RuntimeErrorPossibly taken @chessing234 claimed this 11 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
huggingface/diffusers#15337 · 3 comments ·
Maintainers usually reply within 1 day
-
Multi-vector textual inversion uses only the first vector when the token has uppercase letters (transformers v5)Possibly taken @houyunsun claimed this 13 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
huggingface/diffusers#15313 ·
Maintainers usually reply within 1 day
All issues in huggingface/diffusers
Similar issues
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
MakazhanAlpamys/Soup#3589 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/clickhouse-connect#1266 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
biosustain/growthcurves_app#89 ·
Maintainers usually reply within 1 day
-
`LogProxyConsumer._on_relation_departed` raises `APIError` when the promtail service does not existOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
canonical/loki-k8s-operator#695 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day