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.
-
Try it out with this GPU Colab.
-
Using the command line :
python text2image.py --prompt="An astronaut riding a horse"
- 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")
The following outputs have been generated using the this implementation:
- A epic and beautiful rococo werewolf drinking coffee, in a burning coffee shop. ultra-detailed. anime, pixiv, uhd 8k cryengine, octane render
- Spider-Gwen Gwen-Stacy Skyscraper Pink White Pink-White Spiderman Photo-realistic 4K
- A vision of paradise, Unreal Engine