Repository navigation
Conversation
pcuenca
commented
Nov 21, 2022
pcuenca
commented
Nov 21, 2022
Comment on lines
+498
to
+500
| i = 0 | ||
| t = self.scheduler.timesteps[0] | ||
| while t > 0: |
Member
Author
There was a problem hiding this comment.
We need to keep i and t, which is very ugly. i is only required for the callback.
Comment on lines
+196
to
+199
| if not return_dict: | ||
| return (prev_sample, self.timesteps[step_index]) | ||
|
|
||
| return SchedulerOutput(prev_sample=prev_sample, timestep=self.timesteps[step_index]) |
Member
Author
There was a problem hiding this comment.
Similar implementation as in #1336 except that we return the next timestep.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
|
|
||
| # compute the previous noisy sample x_t -> x_t-1 | ||
| latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs).prev_sample | ||
| latents, t = self.scheduler.step(noise_pred, t, latents, return_dict=False, **extra_step_kwargs) |
Contributor
There was a problem hiding this comment.
Hmm this makes the step function a bit more black-box - not suuuper happy about it at this point of the library, but maybe at some point we have to let the scheduler adapt t anyways. However would still be happier with exposing the whole timestamp array @patil-suraj @anton-l
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Without duplicating the sigmas and timesteps (reference: #1336)
➕
No duplication of sigmas and timesteps.
Does not require ugly function
index_for_timestep(or confusing oneliner repeated twice in the code)➖
Requires modification of all pipelines.
The pipeline loop is uglier.
All in all I don't think we gain any more clarity than in #1336, so I recommend we adopt #1336 unless it's important that the timesteps and sigmas are not duplicated.
This implementation does work. I'll push a fix for #1336 so it works too.