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

Abierto
#15,368 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@SIDDARTHAREDDY8 ya está trabajando en esto.

Desde el 20/11/2026.

  • #15364 de @SIDDARTHAREDDY8 — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python, pytorch

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
35k
Forks
7.5k
Merge medio
2 d 22 h
PR fusionados (30 d)
58

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de huggingface/diffusers

Todos los issues de huggingface/diffusers

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.