diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

multiple prediction options in ddpm, ddim

Open natolambert opened this issue 2 years ago • 13 comments

starting to work on discussion in #778. Please contribute and leave feedback. This is mostly a placeholder for my work right now as I figure out how to do it.

Some relevant repositories:

natolambert avatar Oct 13 '22 00:10 natolambert

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Yes we indeed need this now I think :-) (also for dance diffusion)

patrickvonplaten avatar Oct 14 '22 17:10 patrickvonplaten

I want to make a colab comparing the prediction for training on one scheduler to start (make sure it works). Then we need to make it on more schedulers. Though if I get DDPM done this weekend, it would be good first issues for people to add and test it on other schedulers.

natolambert avatar Oct 14 '22 18:10 natolambert

I'm new to contributing and so I'm a little confused about what I should be doing. Should I clone the changes and make a colab to compare with original predictions?

aandyw avatar Oct 14 '22 20:10 aandyw

Hey @Pie31415,

Since you mentioned you were interested in this PR, I think it'd be super useful to do a PR review here :-)

patrickvonplaten avatar Oct 17 '22 17:10 patrickvonplaten

@Pie31415 Another really useful thing would be to just verify the implementation from the original papers and links above. This is a pretty tricky port so I will do this too, but it would be hugely useful.

For example, I actually think the DDIM implementation is much closer than DDPM.

natolambert avatar Oct 18 '22 18:10 natolambert

FYI here are some examples for DDPM butterfly generations from @bglick13 , we want to see similar results on DDIM than maybe merge this initial version.

natolambert avatar Nov 09 '22 19:11 natolambert

That's very interesting here actually - @patil-suraj @anton-l could you also take a look? :-)

patrickvonplaten avatar Nov 15 '22 21:11 patrickvonplaten

DDIM will hopefully be ready for review soon too.

Results training on it are still a little pixelated, but you can clearly see the shape of a butterfly. I'm guessing I have something not quite right with the variance calculation. Will hopefully have updates here soon!

bglick13 avatar Nov 15 '22 22:11 bglick13

Update for the diffusers team (@patrickvonplaten , @anton-l , @patil-suraj ). We updated DDIM now (promising results), and I'll add tests / fix merge issues this afternoon.

natolambert avatar Nov 17 '22 18:11 natolambert

@patrickvonplaten this should be go to go. Now, this leaves only DPMSolverMultistepSchedulerTest with predict_epsilon rather than prediction_type, but I think it is okay until v-prediction expands in the library.

Lots more good work from @bglick13

natolambert avatar Nov 17 '22 22:11 natolambert

Added more deprecating across the board. I tried to address @patrickvonplaten's comment above, but would like a double check on that!

natolambert avatar Nov 23 '22 20:11 natolambert

The code isn't as clear, but you can see some details on model parametrization in the SD 2.0 code here.

The option parametrization = "v" doesn't show up in the schedulers, though (search query here).

  • noise prediction function is here
  • not much in the ddim / ddpm files, which is confusing.
  • I asked on twitter for clarity.

@patil-suraj @patrickvonplaten @bglick13 (see y'all after thanksgiving)

natolambert avatar Nov 24 '22 01:11 natolambert

Closing this as the changes were integrated into #1505 and other earlier PRs. The added type of v-prediction for DDIM will be addressed in #1010.

natolambert avatar Dec 05 '22 23:12 natolambert