A Keras / Tensorflow implementation of Stable Diffusion.
The weights were ported from the original implementation.
The easiest way to try it out is to use one of the Colab notebooks:
Install using pip with the git repo:
pip install git+https://github.com/jford49/stable-diffusion-tensorflow
Download the repo, either by downloading the zip file or by cloning the repo with git:
git clone [email protected]:jford49/stable-diffusion-tensorflow.git
If you installed the package, you can use it as follows:
from stable_diffusion_tf.stable_diffusion import StableDiffusion
from PIL import Image
generator = StableDiffusion(
img_height=512,
img_width=512,
jit_compile=False,
)
# for image to image :
img = generator.generate(
"A Halloween bedroom",
num_steps=50,
unconditional_guidance_scale=7.5,
temperature=1,
batch_size=1,
input_image="/path/to/img.png"
)
Image.fromarray(img[0]).save("output.png")