You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[DDIMInverseScheduler] inf values at first iteration when set_alpha_to_one=True and prediction_type="sample" #10920
because beta_prod_t is 0.0 at the first iteration, when timestep is < 0 and beta_prod_t is 0.0 (because alpha_prod_t is set to 1.0 when set_alpha_to_one=True).
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
I'd like to help with this issue. I reproduced it at a71e62e on Windows/CPU with Diffusers 0.41.0.dev0, Python 3.11.15 and PyTorch 2.14.0+cpu.
The original example returns Inf. With both sample and model_output set to the same finite tensor, it returns NaN instead (0/0), so an exact x0 prediction still hits this boundary.
At source alpha_prod_t=1, the noise coefficient is zero, so the current sample and x0 prediction do not uniquely determine pred_epsilon. Assigning zero would introduce an additional initialization convention.
Would a clear ValueError when prediction_type="sample" encounters an actual zero source noise coefficient be appropriate, with documentation and CPU regression tests? Or is there a preferred initialization convention to support this boundary? I'd be happy to implement the agreed behavior.
For reference, the unmodified baseline python -X utf8 -m pytest -q tests/schedulers/test_scheduler_ddim_inverse.py gives 34 passed, 1 skipped. Its prediction-type test covers epsilon and v_prediction, but not sample.
Still reproduces on current main (beta_prod_t is 0 at the first inverse step with set_alpha_to_one=True + prediction_type="sample", so pred_epsilon division by beta_prod_t**0.5 diverges). I'd like to work on a fix: guard the epsilon division for the sample-prediction path (mirroring how the forward schedulers avoid divide-by-zero) and add the issue's repro as a regression test in tests/schedulers/test_scheduler_ddim_inverse.py.
A brief follow-up on the first-step sample-prediction boundary. I see #14822 is now closed without merge; before preparing another implementation, could a maintainer clarify whether this zero-noise boundary should raise a clear error or use an explicit initialization convention? I would be happy to refresh the CPU reproduction and add tests for the agreed behavior, with the AI assistance disclosed. Thanks for your time!
AI-assisted follow-up, posted at the contributor's request.
Activity
github-actions commentedon Mar 29, 2025
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
Cr7st commentedon Oct 27, 2025
I encountered the same problem. Currently I am using the scheduler as follows:
But I am not sure if this will have a negative effect on the quality of the result. I think this problem still need to be addressed.
github-actions commentedon Feb 3, 2026
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
NaCr05 commentedon Sep 11, 2026
I'd like to help with this issue. I reproduced it at a71e62e on Windows/CPU with Diffusers 0.41.0.dev0, Python 3.11.15 and PyTorch 2.14.0+cpu.
The original example returns Inf. With both
sampleandmodel_outputset to the same finite tensor, it returns NaN instead (0/0), so an exact x0 prediction still hits this boundary.At source
alpha_prod_t=1, the noise coefficient is zero, so the current sample and x0 prediction do not uniquely determinepred_epsilon. Assigning zero would introduce an additional initialization convention.Would a clear
ValueErrorwhenprediction_type="sample"encounters an actual zero source noise coefficient be appropriate, with documentation and CPU regression tests? Or is there a preferred initialization convention to support this boundary? I'd be happy to implement the agreed behavior.For reference, the unmodified baseline
python -X utf8 -m pytest -q tests/schedulers/test_scheduler_ddim_inverse.pygives 34 passed, 1 skipped. Its prediction-type test coversepsilonandv_prediction, but notsample.DawnofGenX commentedon Sep 20, 2026
Still reproduces on current main (beta_prod_t is 0 at the first inverse step with set_alpha_to_one=True + prediction_type="sample", so pred_epsilon division by beta_prod_t**0.5 diverges). I'd like to work on a fix: guard the epsilon division for the sample-prediction path (mirroring how the forward schedulers avoid divide-by-zero) and add the issue's repro as a regression test in tests/schedulers/test_scheduler_ddim_inverse.py.
NaCr05 commentedon Oct 17, 2026
A brief follow-up on the first-step sample-prediction boundary. I see #14822 is now closed without merge; before preparing another implementation, could a maintainer clarify whether this zero-noise boundary should raise a clear error or use an explicit initialization convention? I would be happy to refresh the CPU reproduction and add tests for the agreed behavior, with the AI assistance disclosed. Thanks for your time!
AI-assisted follow-up, posted at the contributor's request.