-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Improve LCM(-LoRA) Distillation Scripts #6420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
sayakpaul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
- Let's also support interpolation mode in the non-WDS script?
- Might make sense to add
resolve_interpolation_mode()intraining_utils.py, as I imagine it being used in multiple scripts.
|
@patil-suraj can you check here? |
…d make interpolation type configurable in non-WDS script.
patil-suraj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool, lgtm!
examples/consistency_distillation/train_lcm_distill_lora_sd_wds.py
Outdated
Show resolved
Hide resolved
examples/consistency_distillation/train_lcm_distill_lora_sdxl.py
Outdated
Show resolved
Hide resolved
examples/consistency_distillation/train_lcm_distill_lora_sdxl_wds.py
Outdated
Show resolved
Hide resolved
|
Thanks a lot, @dg845! The scripts are in a really good spot now! |
|
|
||
| import numpy as np | ||
| import torch | ||
| from torchvision import transforms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can't have torchvision as a required dependency
* Make WDS pipeline interpolation type configurable. * Make the VAE encoding batch size configurable. * Make lora_alpha and lora_dropout configurable for LCM LoRA scripts. * Generalize scalings_for_boundary_conditions function and make the timestep scaling configurable. * Make LoRA target modules configurable for LCM-LoRA scripts. * Move resolve_interpolation_mode to src/diffusers/training_utils.py and make interpolation type configurable in non-WDS script. * apply suggestions from review
|
Wether TCD distilltion training is supported by Diffusers |
What does this PR do?
This PR makes further improvements to the LCM-(LoRA) distillation scripts.
Changelist:
--interpolation_typeargument.lora_alpha(which controls LoRA scaling) andlora_dropoutparameters configurable via the--lora_alphaand--lora_dropoutarguments respectively.--lora_target_modulesargument.--vae_encode_batch_sizeargument.scalings_for_boundary_conditionsfunction to use thetimestep_scalingargument (instead of it being hardcoded to10.0) and make the scaling factor configurable via--timestep_scaling_factor.Follow-up to #5778.
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@patrickvonplaten
@sayakpaul
@patil-suraj