question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Community] Move the number "0.18215" from the image2image process to VAE config

See original GitHub 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?

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:3
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
patrickvonplatencommented, Oct 5, 2022

Let’s put it maybe directly in the VAE config then ? cc @patil-suraj

2reactions
patrickvonplatencommented, Nov 7, 2022

Think we can have this be a config parameter that is overrideable and a Union[int, str] with the string describing a more complex squashing function that can be implemented down the road.

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 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

What does "0.18215" mean in blog Stable Diffusion with ...
This question came up on GitHub too: Why is there a number "0.18215" in the image2image process · Issue #726 · huggingface/diffusers ·...
Read more >
Stable Diffusion based Image Compression - LinkedIn
To quantize the latents generated by the VAE, I first scaled them by 1 / 0.18215, a number you may have come across...
Read more >
Diagnosing and Enhancing VAE Models - OpenReview
We closely analyze the VAE objective function and draw novel conclusions that lead to simple enhancements.
Read more >
Stable diffusion using Hugging Face - Towards Data Science
The process of converting a text to a number can be broken down ... init_latent_dist = vae.encode(init_image).latent_dist.sample() * 0.18215
Read more >
Train Variational Autoencoder (VAE) to Generate Images
This example shows how to train a deep learning variational autoencoder (VAE) to generate images.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found