-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Advanced DreamBooth LoRA SDXL] Support EDM-style training (follow up of #7126) #7182
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. |
examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.py
Outdated
Show resolved
Hide resolved
def get_sigmas(timesteps, n_dim=4, dtype=torch.float32): | ||
sigmas = noise_scheduler.sigmas.to(device=accelerator.device, dtype=dtype) | ||
schedule_timesteps = noise_scheduler.timesteps.to(accelerator.device) | ||
timesteps = timesteps.to(accelerator.device) | ||
|
||
step_indices = [(schedule_timesteps == t).nonzero().item() for t in timesteps] | ||
|
||
sigma = sigmas[step_indices].flatten() | ||
while len(sigma.shape) < n_dim: | ||
sigma = sigma.unsqueeze(-1) | ||
return sigma |
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.
Add a todo here to revisit different sampling algorithms for obtaining the sigmas. Ideally, Tero Karras should just drop a PR here just sayin' 🤷♂️
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.
Sweet!
Let's add a section about this in the README and ship 🚀
Did you notice anything particularly notable @linoytsaban? |
@sayakpaul wanna take one more look? |
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.
Thanks!
This PR adds support for EDM-style training to the advanced script, based off PR #7126