Skip to content

NoiseScheduler parameters for StableDiffusion are wrong #2049

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

Open
DaniyarM opened this issue Sep 5, 2023 · 6 comments · May be fixed by #2065
Open

NoiseScheduler parameters for StableDiffusion are wrong #2049

DaniyarM opened this issue Sep 5, 2023 · 6 comments · May be fixed by #2065

Comments

@DaniyarM
Copy link

DaniyarM commented Sep 5, 2023

NoiseScheduler https://github.com/keras-team/keras-cv/blob/master/keras_cv/models/stable_diffusion/noise_scheduler.py contains a bug with default parameters. For a pretrained SD it must be: NoiseScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule='scaled_linear', clip_sample=False). For now it is: NoiseScheduler(beta_start=0.0001, beta_end=0.02, beta_schedule='linear', clip_sample=True). As I understand it, this happened because of copy-paste with a hugging face (where the default parameters are taken for some old GANs).

@DaniyarM DaniyarM added the type:Bug Something isn't working label Sep 5, 2023
@jbischof
Copy link
Contributor

jbischof commented Sep 5, 2023

Thanks @DaniyarM! Can you share the source of the corrected parameters?

@DaniyarM
Copy link
Author

DaniyarM commented Sep 5, 2023

It can be obtained from huggingface's diffusers like that :
from diffusers import DDIMScheduler
scheduler = DDIMScheduler.from_pretrained('runwayml/stable-diffusion-v1-5', subfolder='scheduler')
print(scheduler)

Also, it can be found in that article: https://arxiv.org/pdf/2305.08891v2.pdf (Table 1).

@ianstenbit
Copy link
Contributor

Thanks @DaniyarM for pointing this out -- feel free to send a PR to update this!

Copy link

This issue is stale because it has been open for 180 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label Feb 14, 2025
@sachinprasadhs
Copy link
Collaborator

Thanks for reporting the issue! We have consolidated the development of KerasCV into the new KerasHub package, which supports image, text, and multi-modal models. Please read the announcement. KerasHub will support all the core functionality of KerasCV.

KerasHub can be installed with !pip install -U keras-hub. Documentation and guides are available at keras.io/keras_hub.

With our focus shifted to KerasHub, we are not planning any further development or releases in KerasCV. If you encounter a KerasCV feature that is missing from KerasHub, or would like to propose an addition to the library, please file an issue with KerasHub.

Copy link

This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants