<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">You may have heard about DALL-E 2 - the machine learning model that can generate images from a string of text, almost by magic.</div><div class=""><br class=""></div><div class="">Up until recently, in order to play with this or similar tools you had to either apply to get free time, or buy access to a server or service.</div><div class=""><br class=""></div><div class="">Just in the past two weeks, if you have a good enough machine, you can now download a similar model and scripts and run it on your own, which I did. It is pretty amazing. The model is called <i class="">Stable Diffusion</i> and the code is on GitHub. (The model itself is on HuggingFace).</div><div class=""><br class=""></div><div class="">You can even take a photo or image of your own and have the system modify it… here’s an example. Starting with my photo and a prompt of “Henri Rousseau painting house at night”, it turned my photo into a rather cool picture:</div><div class=""><br class=""></div><div class=""><img apple-inline="yes" id="360FB3D4-037E-4826-99B7-12AAE2AC4098" src="cid:1176BA46-2AF2-4F4D-A19F-1B26BDA9B5F5" class=""><img apple-inline="yes" id="FD0DA481-A2A7-4A00-932D-4C962FC40343" src="cid:B90A023E-23D8-4ED1-A232-ACD9E9296D04" class=""></div><div class=""><br class=""></div><div class="">Some notes on this:</div><div class=""><br class=""></div><div class=""><ul class=""><li class="">To download the model from <a href="http://HuggingFace.co" class="">HuggingFace.co</a>, you need to provide your name and email and agree to their terms on avoiding malicious use, etc. The model itself is 4.2gb in size.</li><li class="">I followed these instructions for how to run it on a Mac M1 machine: <a href="https://replicate.com/blog/run-stable-diffusion-on-m1-mac" class="">https://replicate.com/blog/run-stable-diffusion-on-m1-mac</a> </li><li class="">Here’s a good overview of the general situation on this: <a href="https://arstechnica.com/information-technology/2022/09/with-stable-diffusion-you-may-never-believe-what-you-see-online-again/" class="">https://arstechnica.com/information-technology/2022/09/with-stable-diffusion-you-may-never-believe-what-you-see-online-again/</a> - this was the article that got me started on this.</li><li class="">You probably need about 16gb of memory to run the scripts</li><li class="">Input and output pictures are limited to 512 x 512 pixels. (I tried a normal iPhone picture without shrinking it and making it square and the program needed 133gb of memory and failed.)</li><li class="">I did have to edit the img2img.py script to get it to work (copying a line from the text2img.py script).</li><li class="">There are a lot of moral questions about this - what you create, whose artistic work you are implicitly borrowing - but if you choose long-dead artists, I don’t see any harm.</li><li class="">It does not handle faces well; If you ask for a picture of a dog, sometimes the image has the wrong number of legs, etc.</li><li class="">If you want to try this out without using your own machine, you can use this page: <a href="https://replicate.com/stability-ai/stable-diffusion" class="">https://replicate.com/stability-ai/stable-diffusion</a> - it was overloaded yesterday but might be working now.</li></ul></div><div class=""><br class=""></div><div class="">Ping me if you’d like more details. It’s a lot of fun.</div><div class=""><br class=""></div><div class="">-Dave Cooper</div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>