Skip to content

[Bug]: Final Sampling step ruin the image, very visible in DPM2 a #3483

Description

@fernicar

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

Second to Last Sampling step is better than final result, very visible in DPM2 a and similar sampler Karras,
Changing the amount of steps does not fix it, it is always the second to last sampling the one with good results.
Sad to see underrated [DPM2 a] sampler just because a bug, Here is a comparison from current build 6bd6154
Comparisons

Steps to reproduce the problem

  1. Select DPM2 a
  2. Generate

What should have happened?

Perhaps shared.state.sampling_step is not updated and the sample process goes one more step when it shouldn't.

Commit where the problem happens

the good: perhaps there is no good commit yet...
the bad: 7ce7fb0 it ruins last step since Sep 6 2022!
and the ugly: 5766ce2 it defeats "Clip skip: 2" feature since Oct 11 2022

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

--deepdanbooru --xformers --medvram

Additional information, context and logs

This custom script will help you save Sampling steps during testing:
https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Custom-Scripts#saving-steps-of-the-sampling-process
however, the iteration of steps is not counting from 1, but 0

The other problem is in sd_samplers.py > def store_latent(decoded)
This function access shared.state.sampling_step before its update.
For this reason [Show image creation progress every N sampling steps. Set 0 to disable.] will display step 1 and step 2 regardless of bigger N interval, say 5 or 6.
Perhaps this is the reason for the OP bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-reportReport of a bug, yet to be confirmedupstreamIssue or feature that must be resolved upstream

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions