Text-to-image with diffusers

in ai •  2 years ago 

image.png

Are you planning to play with diffusers to generate images from text?

If the answer is yes, then continue reading my experience :)

Diffusers library: https://github.com/huggingface/diffusers.

First, we are going to use the branch ldm-bert from the transformers’ fork made by patil-suraj, because it has the model that will be used by the latent diffusion.

image.png

Checking the versions of transformers and diffusers …

image.png

We are going to use the class DiffusionPipeline to load the latent diffusion model.

image.png

Let’s create a function to show the generated images during the inference steps.

image.png

And now we can see the process of creating some kitties :)

image.png

image.png

If you want to play with the Colab, here it is.

Play with it and share your findings 🤗

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  
Loading...