# Photorealistic Image Synthesis from Text Prompts

**URL:** <https://scanalyst.fourmilab.ch/t/photorealistic-image-synthesis-from-text-prompts/877>\
**Category:** The Happening World\
**Tags:** image-synthesis, artificial-intelligence, computer-graphics\
**Created:** [13 February 2022 15:01 UTC](https://scanalyst.fourmilab.ch/t/photorealistic-image-synthesis-from-text-prompts/877 "2022-02-13T15:01:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnwalker](https://scanalyst.fourmilab.ch/user_avatar/scanalyst.fourmilab.ch/johnwalker/32/17415_2.png) [@johnwalker](https://scanalyst.fourmilab.ch/u/johnwalker)\
**Post date:** [13 February 2022 15:01 UTC](https://scanalyst.fourmilab.ch/t/photorealistic-image-synthesis-from-text-prompts/877/1 "2022-02-13T15:01:38Z")

</div>

[![](https://scanalyst.fourmilab.ch/uploads/default/original/2X/6/6d9922aec3d9a0274df331196da8c219411ddeaf.jpeg "OpenAI GLIDE AI: Astounding Power! 🤖") ](https://www.youtube.com/watch?v=ItKi3h7IY2o)

This is one of the most spectacular things I’ve seen in quite a while. It fuses several artificial intelligence techniques to create or modify images based upon natural language text prompts, including photorealistic rendering of the interaction between modifications to images and the original scene. The technique is described in the paper “[GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Models](https://arxiv.org/abs/2112.10741)”. Here is the abstract.

> Diffusion models have recently been shown to generate high-quality synthetic images, especially when paired with a guidance technique to trade off diversity for fidelity. We explore diffusion models for the problem of text-conditional image synthesis and compare two different guidance strategies: CLIP guidance and classifier-free guidance. We find that the latter is preferred by human evaluators for both photorealism and caption similarity, and often produces photorealistic samples. Samples from a 3.5 billion parameter text-conditional diffusion model using classifier-free guidance are favored by human evaluators to those from DALL-E, even when the latter uses expensive CLIP reranking. Additionally, we find that our models can be fine-tuned to perform image inpainting, enabling powerful text-driven image editing. We train a smaller model on a filtered dataset and release the code and weights at [this https URL](https://github.com/openai/glide-text2im).

You have to try this yourself to appreciate how revolutionary this is. You can run it on Google Colab by visiting the GitHub page for [project GLIDE](https://github.com/openai/glide-text2im), then clicking the “Open in Colab” buttons in the description for the model you wish to try. I produced the following using the [clip\_guided](https://colab.research.google.com/github/openai/glide-text2im/blob/main/notebooks/clip_guided.ipynb) model. For each, I show the prompt and the image(s) that resulted.

### orange cat in the style of Van Gogh

 ![orange_cat_van_gogh](https://scanalyst.fourmilab.ch/uploads/default/original/2X/7/7865efa3072bbfaad3f11982dccfb7e991e86efc.png)

### ants from space

 ![ants_from_space](https://scanalyst.fourmilab.ch/uploads/default/original/2X/8/8833e987c6438004c73ee4883db56d6c0f2d1895.png)

### cats by Picasso

 ![cats_picasso](https://scanalyst.fourmilab.ch/uploads/default/original/2X/9/9e65406c375e34d82dbff690925e9e84da78d787.png)

### corgi wearing a party hat

 ![corgi_party_hat](https://scanalyst.fourmilab.ch/uploads/default/original/2X/9/9c1d449313e5c36d9b6519843dfe7a1a163ead9e.png)

To make your own custom images, load the notebook, then edit the “Sampling parameters” in section 18, setting the `prompt` to describe the image you seek and `batch_size` to the number of images to generate (execution time scales linearly with this number), then from the menu at the top, select Runtime/Run all. If you get anything interesting or amusing, please post it in the comments.

This publicly-available demo is based upon a smaller model than that shown in the video, so results from it may not be as stunning.
