Fix DDIMInverseScheduler#5145
Conversation
|
I can reproduce the results from @richardSHkim ! Agree that this was a bug before and that this PR should fix it. @clarencechen can you also take a look? @richardSHkim can you maybe update the tests of the "Fast tests for PRs" suite: ? So that we can merge the PR here? :-) |
|
@patrickvonplaten Thank you for your check. |
…users into ddim-inversion
|
Waiting a couple more days for potential feedback from @clarencechen but this should be good to merge |
|
Hey @richardSHkim, thanks for doing thorough tests with your PR to check result quality. Early implementations of DDIM inversion were slightly different across research papers and projects in this respect, and I was too focused on making sure that the scheduler steps exactly mirrored the forward (denoising) process to pay attention to the timestep value fed into the UNet. Please merge. |
|
@clarencechen Thanks for your confirmation, and I appreciate your previous work on inverse schedulers! |
|
Awesome! Merging then and fixing the code quality PR directly on main |
|
Great job @richardSHkim |
* fix ddim inverse scheduler * update test of ddim inverse scheduler * update test of pix2pix_zero * update test of diffedit * fix typo --------- Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* fix ddim inverse scheduler * update test of ddim inverse scheduler * update test of pix2pix_zero * update test of diffedit * fix typo --------- Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* fix ddim inverse scheduler * update test of ddim inverse scheduler * update test of pix2pix_zero * update test of diffedit * fix typo --------- Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
What does this PR do?
DDIMInverseScheduleris currently working differently from ddim inversion in prompt-to-prompt.t) for UNet input becomes 1 instead of -19 as done in prompt-to-prompt.step()function ofDDIMInverseSchedulerare same as before (starting from -19).Example code and some results.
Before
From left to right: the original image, the vq-autoencoder reconstruction, the ddim inverted image

After
Before
After
Test with
StableDiffusionPix2PixZeroPipelinetest code from: #2397
Source Image
Before
After
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@patrickvonplaten @clarencechen