stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Fix skip and interrupt buttons for Highres. fix option enabled

Open mezotaken opened this issue 3 years ago • 0 comments

Describe what this pull request is trying to achieve.

Whenever Highres. fix is enabled skip/interrupt will not work as intended in txt2img tab. Related issues: #3181 #3087

Additional notes and description of your changes

Two sampler instances are used in the process (sample -> sample_img2img), whenever interruption or skip happened on the first one, it returned last_latent, as intended. Second time it gets through sample_img2img without any action, so default value of last_latent is None, that was the problem. If interruption occurred while the second sampler was running, it was fine. Hence the dependency in the title of #3087

Initially i just returned the first result if the second is None, but then i noticed it is still possible to replicate the problem if interruption happened before sampler makes one iteration even without highres option. So instead i changed the initial value of the last_latent. This should cover both scenarios.

Environment this was tested in

  • OS: Windows 10
  • Browser: Chrome
  • Graphics card: NVIDIA GTX 1060 6GB

mezotaken avatar Oct 20 '22 20:10 mezotaken