Skip to content

Conversation

hlky
Copy link
Contributor

@hlky hlky commented Nov 18, 2024

What does this PR do?

  • log_sigmas moved out of karras branch
  • _convert_to_exponential and _convert_to_beta return np.ndarray for consistency with _convert_to_karras and other code
  • Just use num_inference_steps for input to _convert_to_exponential and _convert_to_beta, not all schedulers update self.num_inference_steps

Fixes #9951

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.

@yiyixuxu @vladmandic

@vladmandic
Copy link
Contributor

that was fast! :)

@sayakpaul sayakpaul requested a review from yiyixuxu November 19, 2024 01:52
@sayakpaul
Copy link
Member

@vladmandic could you confirm if this is working for you?

@hlky this is extraordinarily fast! Thank you so much!

@HuggingFaceDocBuilderDev

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.

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the fix!

@hlky hlky force-pushed the fix-beta-exponential branch from ca157b7 to f60e096 Compare November 19, 2024 09:14
@hlky
Copy link
Contributor Author

hlky commented Nov 19, 2024

Also fixes incorrect ordering in some schedulers.

@vladmandic
Copy link
Contributor

LGTM!
image
image (1)

@sayakpaul
Copy link
Member

That was a rigorous test, thanks!

Wonder what did you use for the collage? :D

@vladmandic
Copy link
Contributor

Wonder what did you use for the collage? :D

sdnext built-in xyz grid functionality

image

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @hlky!
looked like there were some issues that you fixed here that did not get caught in our previous tests or @vladmandic 's test, I will try to make & run a more complete slow-test on my end and then merge

@@ -347,11 +347,33 @@ def set_timesteps(self, num_inference_steps: int, device: Union[str, torch.devic
)
sigmas = np.concatenate([sigmas, [sigma_last]]).astype(np.float32)
elif self.config.use_exponential_sigmas:
sigmas = self._convert_to_exponential(in_sigmas=sigmas, num_inference_steps=self.num_inference_steps)
log_sigmas = np.log(sigmas)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh so it looked like it was wrong before, thank!

@yiyixuxu yiyixuxu merged commit 637e230 into huggingface:main Nov 20, 2024
13 of 15 checks passed
sayakpaul added a commit that referenced this pull request Dec 23, 2024
* Fix beta and exponential sigmas + add tests

---------

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All schedulers have broken beta and exponential sigma methods
5 participants