-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[Community] Move the number "0.18215" from the image2image process to VAE config #726
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
It's a constant used to scale the # scale and decode the image latents with vae
latents = 1 / 0.18215 * latents
image = vae.decode(latents).sample |
I think the constant is defined in the model config file from CompVis/stable-diffusion. |
There's more explanation about it in #437. |
Let's put it maybe directly in the VAE config then ? cc @patil-suraj |
Maybe this can be a method for a VAE that is overridable? For supporting more complex squashing functions 😉 |
Think we can have this be a config parameter that is overrideable and a Marking this for now as a community feature as it seems like no one finds the time to open a PR here - in case you're interested @neverix - we'd be more than happy to review a PR :-) |
Should be solved by: #1460 @williamberman could you maybe tackle this? |
Put up draft PR here: #1515 still need to think about a few things before finishing |
For reference, here's some code to estimate the magic value: #437 (comment). |
Thanks a lot @fepegar ! |
#1860 is now merged, closing the issue. |
There is a magic number "0.18215" in the repository
In the file
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py
, there is a number "0.18215" in line 220 and line 342, which is strange since it does occur in the original repo. Is there someone clarifying why is that and where does this number come from?The text was updated successfully, but these errors were encountered: