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

Fix prompt schedule for second order samplers

Open catboxanon opened this issue 2 years ago • 0 comments
trafficstars

Describe what this pull request is trying to achieve.

Closes https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/7508

Second order samplers (Heun, DPM2/a, DPM++ 2S/a, DPM++ SDE / Karras) cause the prompt schedule to run twice as fast when prompting something like [dog:cat:0.5] (i.e. for 100 steps, prompt is dog until step 25, cat until 50, and remains dog until 100). This fixes that by checking if the sampler is any of these second order samplers and multiplies the step count by 2 for calculating the prompt schedule.

Additional notes and description of your changes

I've also added a compatibility option to replicate old seeds, as it's otherwise impossible to replicate them since the prompt would always run as twice as fast.

Environment this was tested in

  • OS: Windows 11
  • Browser: Firefox
  • Graphics card: NVIDIA RTX 3090

catboxanon avatar Apr 17 '23 00:04 catboxanon