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

how to use ddim_reverse_sample?

Open wrx33 opened this issue 2 years ago • 2 comments

I am trying to use the ddim_reverse_sample to get the noise used to generate the image. I simply replaced the ddim_sample with the ddim_reverse_sample in the ddim_sample_loop_progressive function, but it seems does not work. I got an all-255 np.array. Could anyone please help me? thanks a lot.

wrx33 avatar Mar 13 '23 03:03 wrx33

I am trying to use the ddim_reverse_sample to get the noise used to generate the image. I simply replaced the ddim_sample with the ddim_reverse_sample in the ddim_sample_loop_progressive function, but it seems does not work. I got an all-255 np.array. Could anyone please help me? thanks a lot.

I have the same problem. Maybe we can discuss together. You can contact me through my email :)

Tonniia avatar May 17 '23 13:05 Tonniia

In case this is still an issue, remember to reverse the timestep indices for reverse sampling.

indices = list(range(self.num_timesteps))#[::-1] # comment out [::-1]

The original indices in ddim_sample_loop_progressive is from T to 0. You want it from 0 to T.

ajrheng avatar Jun 19 '23 04:06 ajrheng