diffusion fails on certain step counts

#3386
by sulf1re - opened

i've been doing an experiment to see the effect of step changes on a single image at strength 0.97, with a one word prompt, keeping the seed the same. This is due to remarkable variations between step counts on output, that does not make sense to me.

I found that the image generation failed for step counts of 3, 9, 27, giving me an out of bounds error within the diffuser:

/usr/local/lib/python3.7/dist-packages/diffusers/schedulers/scheduling_pndm.py in get_prev_sample(self, sample, timestep, timestep_prev, model_output)
336 # model_output -> e_θ(x_t, t)
337 # prev_sample -> x
(t−δ)
--> 338 alpha_prod_t = self.alphas_cumprod[timestep + 1 - self._offset]
339 alpha_prod_t_prev = self.alphas_cumprod[timestep_prev + 1 - self._offset]
340 beta_prod_t = 1 - alpha_prod_t

IndexError: index 1000 is out of bounds for dimension 0 with size 1000

Just thought i'd mention it, as its a very odd error, and makes me wonder if there is a bug in the code that means the step count is not working as expected.

I countered the same problem!

Sign up or log in to comment