LCMScheduler advances the generator on the final step of a strength-truncated custom schedule

Aperta
#15,368 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@SIDDARTHAREDDY8 ci sta già lavorando.

Dal 20/11/2026.

  • #15364 di @SIDDARTHAREDDY8 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, pytorch

Direzione di ricerca

Read LCMScheduler.step and compare it with the TCDScheduler change from #15301, which fixed the same final-step check. Reproduce with a seeded generator and a truncated schedule (timesteps=[999, 499, 19], strength=0.5), then use the regression test test_truncated_custom_timesteps_final_step_preserves_generator from #15364 as the done signal. Note that a fix is already proposed in #15364, so coordinate there before starting.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

When LCMScheduler uses a non-empty custom timestep schedule truncated by strength < 1, its actual final step advances the supplied random generator even though the sampled noise is never used.

For example, timesteps=[999, 499, 19] with strength=0.5 leaves only [19], but num_inference_steps remains 3. The final-step check uses the original step count and enters the noise-sampling branch.

Same bug class as #15288 (fixed for TCDScheduler in #15301); a follow-up to the review on #15301, which suggested applying the same one-line change to LCMScheduler.step. A fix is proposed in #15364.

Reproduction

Call LCMScheduler.step with a truncated custom schedule (e.g. timesteps=[999, 499, 19], strength=0.5) and a seeded generator: the generator state advances on the final step on unpatched code. Regression test test_truncated_custom_timesteps_final_step_preserves_generator in #15364 fails on unpatched code and passes with the fix.

Expected behavior

The generator state should be untouched on the actual final step of the truncated schedule.

Lingua principale
Python
Stelle
35k
Fork
7.5k
Merge medio
2g 22h
PR unite (30g)
58

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di huggingface/diffusers

Tutte le issue di huggingface/diffusers

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.