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

Out-of-bounds index errors for select img2img inputs owing to steps_out = ddim_timesteps + 1

Open jtkelm2 opened this issue 3 years ago • 2 comments

It took a bit of tracing through the callstack to find out what was the matter when I ran certain img2img parameters (such as ddim_steps = 27 and strength = 1), but I believe it is this line in util.py for the make_ddim_timesteps method: steps_out = ddim_timesteps + 1. Consequently the last index may be 1000, triggering an OOB error later when it tries to access the 1000th element of alphacums.

There is this comment in the code to explain the +1:

# add one to get the final alpha values right (the ones from first scale to data during sampling)

but I don't know what to make of it. Is this necessary?

jtkelm2 avatar Aug 25 '22 01:08 jtkelm2

Can confirm I also get OOB returns when I set 'strength = 1'

sparta218 avatar Aug 25 '22 05:08 sparta218

I get the error when I increase ddim_steps above 250.

TapuCosmo avatar Aug 26 '22 21:08 TapuCosmo