See How AI Generates Images from Text

Generative AI algorithms use probability to create visuals from noise

Person surrounded by black boxes. Each black box has a glowing screen with a similar base image projected on it. A few versions of the image are crisp. One includes static.

Matthew Twombly

Join Our Community of Science Lovers!

In 2022 the Internet got its first taste of image-generating artificial intelligence. Suddenly, technology that had once been offered only to specialists was available to anyone with a web connection. The enthusiasm shows no signs of abating, and AI-generated images have won a major photography competition, created the title credits of a television series and tricked people into believing the pope stepped out in a fashionable puffer coat. Yet critics have noted how training the algorithms on existing works could potentially infringe on copyright, and using them could put artists’ jobs in jeopardy. Generative AI also risks supercharging fake news: the pope coat was fun, but a generated photograph supposedly showing an attack on the Pentagon briefly inspired a dip in the stock market.

How did programs such as DALL-E 2, Midjourney and Stable Diffusion get to be so good all at once? Although AI has been in development for decades, the most popular of today’s image generators use a technique called a diffusion model, which is relatively new on the AI scene. Here’s how it works:

A sequential graphic shows how diffusion-model AI image generators work.

Matthew Twombly (graphic), Amanda Hobbs (research)


On supporting science journalism

If you're enjoying this article, consider supporting our award-winning journalism by subscribing. By purchasing a subscription you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.


Sophie Bushwick was formerly the technology editor at Scientific American. She makes frequent appearances on radio shows such as Science Friday and television networks, including CBS, MSNBC and National Geographic. She has more than a decade of experience as a science journalist based in New York City and previously worked at outlets such as Popular Science,Discover and Gizmodo. Follow Bushwick on X (formerly Twitter) @sophiebushwick

More by Sophie Bushwick

Matthew Twombly is a freelance illustrator and infographic designer. His work can be viewed at www.matthewtwombly.com

More by Matthew Twombly

Amanda Hobbs is a freelance researcher, writer and visual content editor specializing in storytelling via art and information graphics. Her work can be viewed at www.athcreative.com

More by Amanda Hobbs
Scientific American Magazine Vol 329 Issue 3This article was published with the title “How AI Generates Images from Text” in Scientific American Magazine Vol. 329 No. 3 (), p. 66
doi:10.1038/scientificamerican1023-66

It’s Time to Stand Up for Science

If you enjoyed this article, I’d like to ask for your support. Scientific American has served as an advocate for science and industry for 180 years, and right now may be the most critical moment in that two-century history.

I’ve been a Scientific American subscriber since I was 12 years old, and it helped shape the way I look at the world. SciAm always educates and delights me, and inspires a sense of awe for our vast, beautiful universe. I hope it does that for you, too.

If you subscribe to Scientific American, you help ensure that our coverage is centered on meaningful research and discovery; that we have the resources to report on the decisions that threaten labs across the U.S.; and that we support both budding and working scientists at a time when the value of science itself too often goes unrecognized.

In return, you get essential news, captivating podcasts, brilliant infographics, can't-miss newsletters, must-watch videos, challenging games, and the science world's best writing and reporting. You can even gift someone a subscription.

There has never been a more important time for us to stand up and show why science matters. I hope you’ll support us in that mission.

Thank you,

David M. Ewalt, Editor in Chief, Scientific American

Subscribe