divamgupta / stable-diffusion-tensorflow
- среда, 21 сентября 2022 г. в 00:32:25
Tensorflow port of the Stable Diffusion Model
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"
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: