Skip to content

Latest commit

 

History

History
66 lines (42 loc) · 1.81 KB

README.md

File metadata and controls

66 lines (42 loc) · 1.81 KB

Stable Diffusion in TensorFlow / Keras

A Keras / Tensorflow implementation of Stable Diffusion.

This is a fork of stable-diffusion-tensorflow created by @divamgupta. The weights were ported from the original implementation.

Usage

  1. Try it out with this GPU Colab.

  2. Using the command line :

python text2image.py --prompt="An astronaut riding a horse"
  1. Using the python interface:
pip install git+https://github.com/fchollet/stable-diffusion-tensorflow
from stable_diffusion_tf.stable_diffusion import Text2Image
from PIL import Image

generator = Text2Image( 
    img_height=512,
    img_width=512,
    jit_compile=False,
)
img = generator.generate(
    "An astronaut riding a horse",
    num_steps=50,
    unconditional_guidance_scale=7.5,
    temperature=1,
	batch_size=1,
)
Image.fromarray(img[0]).save("output.png")

Example outputs

The following outputs have been generated using the this implementation:

  1. A epic and beautiful rococo werewolf drinking coffee, in a burning coffee shop. ultra-detailed. anime, pixiv, uhd 8k cryengine, octane render

a

  1. Spider-Gwen Gwen-Stacy Skyscraper Pink White Pink-White Spiderman Photo-realistic 4K

a

  1. A vision of paradise, Unreal Engine

a

References

  1. https://github.com/CompVis/stable-diffusion
  2. https://github.com/geohot/tinygrad/blob/master/examples/stable_diffusion.py