/stable-diffusion

Stable Diffusion in PyTorch without any huggingface token!

Primary LanguagePythonApache License 2.0Apache-2.0

Stable Diffusion in PyTorch

No Hugginface Token Required

Implementation of Stable Diffusion in PyTorch, for personal interest and learning purpose.

Weights are stored on a huggingface hub repository and automatically downloaded and cached at runtime.

Usage

The easiest way to give it a shot is using one of the following Colab Notebooks:

Example output

textual prompt output
"Italy with cyberpunk style" image
"Galileo in Disney style" image
"DSLR photograph of an astronut riding a horse" image
"Realistic Gandalf playing the piano" image
"Eren from Attack on Titan drinking wine" image

Acknowledgements

The implementation is based on this repository, which is based on these repositories:

Difference with the original implementation

  • the ClipTokenizer has been rewritten to exploit LRU Caching
  • the weights and vocabulary download process has entirely automated so that no manual action is required from the user
  • add a progress bar to track the generation process and provided a generation script
  • the code has been