Skip to content

Conversation

@bglick13
Copy link
Contributor

Starting to work on implementing PROGRESSIVE DISTILLATION FOR FAST SAMPLING OF DIFFUSION MODELS

This is very much a draft PR. So far I've included a toy example in a notebook.

First, it trains an unconditional image diffusion model on a single image. Then, it implements the distillation training procedure - training a student model to produce the same output in N // 2 steps.

TODOs include:

  • Verify the equation block in the distillation function is correct
  • Test on multiple iterations of distillation (i.e., N = 1000 -> 500 -> 250...)
  • Test on a larger image dataset
  • Clean up changes in DDIM scheduler
  • Convert distillation process to a pipeline(?) or script

@bglick13
Copy link
Contributor Author

@lukovnikov sorry for the delayed response. I think that's an important meta decision to make with the Diffusers team! I've seen a similar approach e.g., in the Imagic PR. For now I'm still working on getting the distillation results as good as the paper's!

@lukovnikov
Copy link
Contributor

@bglick13 I've also implemented distillation in my fork: https://github.com/lukovnikov/diffusers/blob/mine/examples/unconditional_image_generation/distill_unconditional.py
However, I'm facing some strange issues where the contrast of the generated images is increased after every distillation phase. Did you have similar issues and did you manage to reproduce the paper's results?

@Thomas-MMJ
Copy link

Thomas-MMJ commented Dec 14, 2022

lukovnikov - at a guess the clip text encoder tokens are also being trained and are becoming 'longer' (attention focuses more on longer vectors which are concepts that the text encoder knows well, which is why popular celebrities can get an overbaked appearance in default models) which causes the images to be overbaked.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2023

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Jan 8, 2023
@github-actions github-actions bot closed this Jan 17, 2023
PhaneeshB pushed a commit to nod-ai/diffusers that referenced this pull request Mar 1, 2023
@adhikjoshi
Copy link

@patrickvonplaten do you think this is something to give it a try again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Issues that haven't received updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants