-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Add K-LMS scheduler from k-diffusion #185
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3691a1e
test LMS with LDM
anton-l f5017b7
test LMS with LDM
anton-l c644dc8
Merge remote-tracking branch 'upstream/main' into lms-scheduler
anton-l 8be3114
Interchangeable sigma and timestep. Added dummy objects
anton-l eb1aee4
Debug
anton-l ad7d92f
Merge master
anton-l ab50168
cuda generator
anton-l 5fe7895
Fix derivatives
anton-l 79efde4
Merge remote-tracking branch 'upstream/main' into lms-scheduler
anton-l 1be0071
Update tests
anton-l 4aa07f5
Rename Lms->LMS
anton-l File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update tests
- Loading branch information
commit 1be007191eb4c10b1cdaaa89a5237b605d175ab1
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,7 +125,10 @@ def __call__( | |
| noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond) | ||
|
|
||
| # compute the previous noisy sample x_t -> x_t-1 | ||
| latents = self.scheduler.step(noise_pred, i, latents, **extra_step_kwargs)["prev_sample"] | ||
| if isinstance(self.scheduler, LmsDiscreteScheduler): | ||
| latents = self.scheduler.step(noise_pred, i, latents, **extra_step_kwargs)["prev_sample"] | ||
| else: | ||
| latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs)["prev_sample"] | ||
|
||
|
|
||
| # scale and decode the image latents with vae | ||
| latents = 1 / 0.18215 * latents | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
shouldn't we maybe pass the sigma here?
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.
Ok we need it anyway - good to leave as is for me!
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.
The
iis needed inside thestepfor other calculations too, and we can't reverse the sigma intoi, so we'll need it like this until a more full refactor.