<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: dalle</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/dalle.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2025-03-25T21:11:23+00:00</updated><author><name>Simon Willison</name></author><entry><title>Introducing 4o Image Generation</title><link href="https://simonwillison.net/2025/Mar/25/introducing-4o-image-generation/#atom-tag" rel="alternate"/><published>2025-03-25T21:11:23+00:00</published><updated>2025-03-25T21:11:23+00:00</updated><id>https://simonwillison.net/2025/Mar/25/introducing-4o-image-generation/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://openai.com/index/introducing-4o-image-generation/"&gt;Introducing 4o Image Generation&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
When OpenAI first announced GPT-4o &lt;a href="https://simonwillison.net/2024/May/13/gpt-4o/"&gt;back in May 2024&lt;/a&gt; one of the most exciting features was true multi-modality in that it could both input &lt;em&gt;and&lt;/em&gt;  output audio and images. The "o" stood for "omni", and the image output examples &lt;a href="https://openai.com/index/hello-gpt-4o/"&gt;in that launch post&lt;/a&gt; looked really impressive.&lt;/p&gt;
&lt;p&gt;It's taken them over ten months (and Gemini &lt;a href="https://developers.googleblog.com/en/experiment-with-gemini-20-flash-native-image-generation/"&gt;beat them to it&lt;/a&gt;) but today they're finally making those image generation abilities available, live right now in ChatGPT for paying customers.&lt;/p&gt;
&lt;p&gt;My test prompt for any model that can manipulate incoming images is "Turn this into a selfie with a bear", because you should never take a selfie with a bear! I fed ChatGPT &lt;a href="https://static.simonwillison.net/static/2025/selfie.jpg"&gt;this selfie&lt;/a&gt; and got back this result:&lt;/p&gt;
&lt;p&gt;&lt;img alt="It's a selfie, there's a grizzly bear over my shoulder smiling." src="https://static.simonwillison.net/static/2025/selfie-with-a-bear.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;That's pretty great! It mangled the text on my T-Shirt (which says "LAWRENCE.COM" in a creative font) and added a second visible AirPod. It's very clearly me though, and that's definitely a bear.&lt;/p&gt;
&lt;p&gt;There are plenty more examples in &lt;a href="https://openai.com/index/introducing-4o-image-generation/"&gt;OpenAI's launch post&lt;/a&gt;, but as usual the most interesting details are tucked away in &lt;a href="https://openai.com/index/gpt-4o-image-generation-system-card-addendum/"&gt;the updates to the system card&lt;/a&gt;. There's lots in there about their approach to safety and bias, including a section on "Ahistorical and Unrealistic Bias" which feels inspired by Gemini's &lt;a href="https://blog.google/products/gemini/gemini-image-generation-issue/"&gt;embarrassing early missteps&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One section that stood out to me is their approach to images of public figures. The new policy is much more permissive than for DALL-E - highlights mine:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;4o image generation is capable, in many instances, of generating a depiction of a public figure based solely on a text prompt.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;At launch, we are not blocking the capability to generate adult public figures&lt;/strong&gt; but are instead implementing the same safeguards that we have implemented for editing images of photorealistic uploads of people. For instance, this includes seeking to block the generation of photorealistic images of public figures who are minors and of material that violates our policies related to violence, hateful imagery, instructions for illicit activities, erotic content, and other areas. &lt;strong&gt;Public figures who wish for their depiction not to be generated can opt out&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This approach is more fine-grained than the way we dealt with public figures in our DALL·E series of models, where we used technical mitigations intended to prevent any images of a public figure from being generated. &lt;strong&gt;This change opens the possibility of helpful and beneficial uses in areas like educational, historical, satirical and political speech&lt;/strong&gt;. After launch, we will continue to monitor usage of this capability, evaluating our policies, and will adjust them if needed.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Given that "public figures who wish for their depiction not to be generated can opt out" I wonder if we'll see a stampede of public figures to do exactly that!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: There's significant confusion right now over this new feature because it is being rolled out gradually but older ChatGPT can still generate images using DALL-E instead... and there is no visual indication in the ChatGPT UI explaining which image generation method it used!&lt;/p&gt;
&lt;p&gt;OpenAI made the same mistake last year &lt;a href="https://simonwillison.net/2024/May/15/chatgpt-in-4o-mode/"&gt;when they announced ChatGPT advanced voice mode&lt;/a&gt; but failed to clarify that ChatGPT was still running the previous, less impressive voice implementation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 2&lt;/strong&gt;: Images created with DALL-E through the ChatGPT web interface now show a note with a warning:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Created with DALL-E with an information icon. Clicking it reveals DALL-E is OpenAI's legacy image generation model. A new model is rolling out in ChatGPT soon." src="https://static.simonwillison.net/static/2025/dall-e-warning.jpg" /&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/ai"&gt;ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/openai"&gt;openai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/dalle"&gt;dalle&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generative-ai"&gt;generative-ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/chatgpt"&gt;chatgpt&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/llms"&gt;llms&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/gemini"&gt;gemini&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/multi-modal-output"&gt;multi-modal-output&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai-ethics"&gt;ai-ethics&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/llm-release"&gt;llm-release&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai-bias"&gt;ai-bias&lt;/a&gt;&lt;/p&gt;



</summary><category term="ai"/><category term="openai"/><category term="dalle"/><category term="generative-ai"/><category term="chatgpt"/><category term="llms"/><category term="gemini"/><category term="multi-modal-output"/><category term="ai-ethics"/><category term="llm-release"/><category term="ai-bias"/></entry><entry><title>Now add a walrus: Prompt engineering in DALL‑E 3</title><link href="https://simonwillison.net/2023/Oct/26/add-a-walrus/#atom-tag" rel="alternate"/><published>2023-10-26T21:11:39+00:00</published><updated>2023-10-26T21:11:39+00:00</updated><id>https://simonwillison.net/2023/Oct/26/add-a-walrus/#atom-tag</id><summary type="html">
    &lt;p&gt;Last year I wrote about &lt;a href="https://simonwillison.net/2022/Jun/23/dall-e/"&gt;my initial experiments with DALL-E 2&lt;/a&gt;, OpenAI's image generation model. I've been having an &lt;em&gt;absurd&lt;/em&gt; amount of fun playing with its sequel, DALL-E 3 recently. Here are some notes, including &lt;a href="https://simonwillison.net/2023/Oct/26/add-a-walrus/#peeking-under-the-hood"&gt;a peek under the hood&lt;/a&gt; and some notes on the &lt;a href="https://simonwillison.net/2023/Oct/26/add-a-walrus/#the-leaked-dall-e-prompt"&gt;leaked system prompt&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;DALL-E 3 is available via ChatGPT Plus. For $20/month you get GPT-4 access, DALL-E 3, &lt;a href="https://simonwillison.net/2023/Oct/14/multi-modal-prompt-injection/"&gt;GPT Vision&lt;/a&gt;, Code Interpreter (aka &lt;a href="https://simonwillison.net/2023/Oct/17/open-questions/#open-questions.036.jpeg"&gt;Coding Intern&lt;/a&gt;), &lt;a href="https://simonwillison.net/2023/Mar/24/datasette-chatgpt-plugin/"&gt;ChatGPT Plugins&lt;/a&gt; and the new, weird and slightly dystopian &lt;a href="https://fedi.simonwillison.net/@simon/111292801843094073"&gt;voice chat feature&lt;/a&gt; in the ChatGPT mobile apps. It's absolutely worth the money, for the combined entertainment value alone.&lt;/p&gt;
&lt;p&gt;A fascinating thing about DALL-E 3 is that you don't prompt it directly: you instead access it via ChatGPT, which prompts the model for you.&lt;/p&gt;
&lt;p&gt;ChatGPT then turns your query into several prompts, each producing a different image. The prompts it generates are available if you click on the images (on mobile you have to flip your phone horizontal to see that option).&lt;/p&gt;
&lt;p&gt;I started by typing this into ChatGPT with DALL-E enabled:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A super posh pelican with a monocle watching the Monaco F1&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It gave me these four images. I've included the prompt it used for each one:&lt;/p&gt;
&lt;div style="
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 10px;
    margin-bottom: 1em;"&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/pelican-1-1.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/pelican-1-1.png" alt="Pelican 1" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Photo of a refined pelican wearing a shiny gold monocle, perched on a railing with the Monaco Grand Prix F1 race in the background. The race cars blur past on the circuit, while yachts are anchored in the nearby harbor.&lt;/figcaption&gt;
    &lt;/figure&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/pelican-1-2.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/pelican-1-2.png" alt="Pelican 2" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Illustration of a sophisticated pelican donning a crystal clear monocle, observing the Monaco F1 race with keen interest. The race track is filled with speeding F1 cars, and the Mediterranean Sea sparkles in the distance with luxurious yachts.&lt;/figcaption&gt;
    &lt;/figure&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/pelican-1-3.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/pelican-1-3.png" alt="Pelican 3" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Watercolor painting of a posh pelican, its feathers groomed to perfection, equipped with a delicate monocle. It stands tall with the iconic Monaco F1 race happening behind it, cars racing at breakneck speeds and the shimmering sea beyond.&lt;/figcaption&gt;
    &lt;/figure&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/pelican-1-4.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/pelican-1-4.png" alt="Pelican 4" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Vector image of an elegant pelican with a classy monocle, standing gracefully against the backdrop of the Monaco Grand Prix. The F1 cars create a colorful streak as they race, and lavish yachts float in the nearby waters.&lt;/figcaption&gt;
    &lt;/figure&gt;
&lt;/div&gt;
&lt;p&gt;Note how the prompts it generates cover four different styles - photo, illustration, watercolor painting and vector image. They also use pleasing and varied language to describe different aspects of the image.&lt;/p&gt;
&lt;p&gt;ChatGPT is prompting DALL-E for us!&lt;/p&gt;
&lt;p&gt;The really fun thing though is that you can ask it follow-ups.&lt;/p&gt;
&lt;p&gt;I said:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;More like the first one please&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And got back:&lt;/p&gt;
&lt;div style="
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 10px;
    margin-bottom: 1em;"&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/pelican-2-1.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/pelican-2-1.png" alt="Pelican 1" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Photo of an aristocratic pelican adorned with a golden monocle, perched confidently with the Monaco Grand Prix F1 race unfolding behind it. The Formula 1 cars zip by on the circuit, while opulent yachts are moored in the nearby marina.&lt;/figcaption&gt;
    &lt;/figure&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/pelican-2-2.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/pelican-2-2.png" alt="Pelican 2" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Photo of a regal pelican with a polished monocle, standing prominently against the backdrop of the Monaco F1 race. The roar of the engines can almost be heard as the cars speed past, and the glinting sea is dotted with luxurious boats.&lt;/figcaption&gt;
    &lt;/figure&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/pelican-2-3.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/pelican-2-3.png" alt="Pelican 3" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Photo of a distinguished pelican sporting a gleaming monocle, observing the Monaco Grand Prix from a vantage point. Racing cars leave a trail of dust as they navigate the circuit, with the blue sea and anchored yachts completing the panorama.&lt;/figcaption&gt;
    &lt;/figure&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/pelican-2-4.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/pelican-2-4.png" alt="Pelican 4" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Photo of a chic pelican, its eye magnified by a pristine monocle, captivated by the Monaco F1 race happening just meters away. The racetrack buzzes with activity as F1 cars race, and the horizon showcases the grandeur of the harbor with its yachts.&lt;/figcaption&gt;
    &lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;Next I added what is becoming my universal DALL-E 3 follow-up prompt, always guaranteed to produce better results:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Add a walrus&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The result:&lt;/p&gt;

&lt;div style="
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 10px;
    margin-bottom: 1em;"&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/add-walrus-1.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/add-walrus-1.png" alt="Pelican and a walrus (mostly off screen)" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Photo of a posh pelican with a golden monocle and a distinguished walrus, both observing the Monaco Grand Prix F1 race. The pelican is perched on a railing while the walrus lounges nearby. Formula 1 cars race by on the circuit, with lavish yachts in the marina behind them.&lt;/figcaption&gt;
    &lt;/figure&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/add-walrus-2.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/add-walrus-2.png" alt="Pelican and a walrus, excellent" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Photo of an aristocratic pelican and a stately walrus side by side, watching the Monaco F1 with keen interest. The pelican has a monocle, and the walrus's tusks shine brightly. The race track is alive with the sound of roaring engines, and the harbor is filled with luxurious boats.&lt;/figcaption&gt;
    &lt;/figure&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/add-walrus-3.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/add-walrus-3.png" alt="Weird pelican walrus hybrid" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Photo of a regal pelican, its eye magnified by a monocle, and a majestic walrus with gleaming tusks, both captivated by the Monaco Grand Prix. The racetrack is a blur of speed, and the horizon showcases the grandeur of the harbor and its anchored yachts.&lt;/figcaption&gt;
    &lt;/figure&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/add-walrus-4.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/add-walrus-4.png" alt="Pelican and a walrus" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Photo of a chic pelican with a pristine monocle and a sophisticated walrus, both engrossed in the Monaco F1 race. The pelican stands on a vantage point, and the walrus sits comfortably beside it. Racing cars zoom past, and the sea is dotted with opulent boats.&lt;/figcaption&gt;
    &lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;That &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/add-walrus-2.png"&gt;second one&lt;/a&gt; is &lt;em&gt;amazing&lt;/em&gt; - exactly what I want from a photo of a posh pelican and a walrus watching the Monaco Grand Prix.&lt;/p&gt;
&lt;p&gt;I also enjoy how the &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/add-walrus-3.png"&gt;third image&lt;/a&gt; ended up as a weird Pelican-Walrus hybrid, with tusks, a monocle and pelican feathers for the hair and whiskers.&lt;/p&gt;
&lt;p&gt;Then &lt;a href="https://twitter.com/BrockMcBreadcat/status/1717581286733127701"&gt;@BrockMcBreadcat suggested&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Now make them muppets&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div style="
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 10px;
    margin-bottom: 1em;"&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/muppets-1.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/muppets-1.png" alt="Pelican and a walrus muppets 1" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Photo of Muppet versions of a pelican and a walrus, both with exaggerated, comical features. The pelican Muppet wears a monocle and the walrus Muppet sports oversized tusks. They are animatedly discussing the Monaco Grand Prix F1 race, with caricatured F1 cars and yachts in the background.&lt;/figcaption&gt;
    &lt;/figure&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/muppets-2.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/muppets-2.png" alt="Pelican and a walrus muppets 2" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Illustration of Muppet-inspired pelican and walrus characters. The pelican has a large, beady eye accentuated by a monocle, while the walrus has a playful grin and prominent tusks. They are engrossed in the Monaco F1 race, with whimsical racing cars and yachts creating a lively backdrop.&lt;/figcaption&gt;
    &lt;/figure&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/muppets-3.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/muppets-3.png" alt="Pelican and a walrus muppets 3" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Photo of two Muppet characters: a pelican with a monocle and a walrus with big, goofy tusks. They're seated in a Muppet-style commentary booth, providing humorous commentary on the Monaco Grand Prix. Cartoonish F1 cars race by, and colorful yachts are seen in the distance.&lt;/figcaption&gt;
    &lt;/figure&gt;
    &lt;figure style="margin: 0"&gt;
        &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/muppets-4.png" style="border: none"&gt;&lt;img loading="lazy" style="width: 100%" src="https://static.simonwillison.net/static/2023/dalle-3/muppets-4.png" alt="Pelican and a walrus muppets 4" /&gt;&lt;/a&gt;
        &lt;figcaption&gt;Illustration of a pelican and walrus as Muppet characters. The pelican Muppet looks sophisticated with its monocle, and the walrus Muppet chuckles with its oversized tusks. They are enjoying the Monaco F1 race, with the track filled with Muppet-style racing cars and quirky yachts.&lt;/figcaption&gt;
    &lt;/figure&gt;
&lt;/div&gt;
&lt;p&gt;LOVE that &lt;a href="https://static.simonwillison.net/static/2023/dalle-3/muppets-3.png"&gt;third one&lt;/a&gt;!&lt;/p&gt;
&lt;h4 id="reusing-seeds"&gt;Reusing seeds&lt;/h4&gt;
&lt;p&gt;I &lt;a href="https://twitter.com/simonw/status/1717547946424897764"&gt;mentioned on Twitter&lt;/a&gt; that it was a shame you can't reuse elements of an image for further visual consistency... and was pointed to &lt;a href="https://twitter.com/itsPaulAi/status/1717197004651044914"&gt;a thread by Paul Couvert&lt;/a&gt; explaining how to do exactly that using seeds.&lt;/p&gt;
&lt;p&gt;I didn't believe this would work - my mental model of how random number seeds and image generation models work doesn't fit what happened next.&lt;/p&gt;
&lt;p&gt;I wrote:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What is the seed for image three?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;ChatGPT replied:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The seed for the third image is 1379049893. If you have any other questions or requests, please let me know!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Then I said:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Add bow ties to both characters in seed 1379049893&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="https://static.simonwillison.net/static/2023/dalle-3/pelican-walrus-muppet-bowtie.png" style="border: none"&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2023/dalle-3/pelican-walrus-muppet-bowtie.png" alt="A muppet pelican and a muppet walrus with bowties in front of the Monaco Grand Prix" style="max-width: 100%;" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Photo of two Muppet characters: a pelican with a monocle and a bow tie, and a walrus with big, goofy tusks and a dapper bow tie. They're seated in a Muppet-style commentary booth, providing humorous commentary on the Monaco Grand Prix. Cartoonish F1 cars race by, and colorful yachts are seen in the distance.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I'm pretty stunned by this. It's not an exact recreation - the boats in the background have changed slightly, and it added a top hat that I wasn't expecting. But it's pretty close!&lt;/p&gt;
&lt;p&gt;People have been trying to figure out hacks to get Midjourney to create consistent characters for the past year, and DALL-E 3 apparently has that ability as an undocumented feature!&lt;/p&gt;
&lt;h4 id="peeking-under-the-hood"&gt;Peeking under the hood&lt;/h4&gt;
&lt;p&gt;Let's see if we can find out a bit more about how this works.&lt;/p&gt;
&lt;p&gt;I used the Firefox DevTools network inspector to grab the JSON representation of my conversation with ChatGPT. Here's &lt;a href="https://gist.github.com/simonw/832d141d776b0752503b1748224921c0"&gt;a pretty-printed copy&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;At &lt;a href="https://gist.github.com/simonw/832d141d776b0752503b1748224921c0#file-dalle-3-json-L1087"&gt;line 1087&lt;/a&gt; you can see the point where I asked it to "Add bow ties to both characters in seed 1379049893".&lt;/p&gt;
&lt;p&gt;The next message in the transcript looks like this:&lt;/p&gt;
&lt;div class="highlight highlight-source-json"&gt;&lt;pre style="white-space: pre-wrap"&gt;{
    &lt;span class="pl-ent"&gt;"id"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;5300d51c-794d-4d5f-bf75-6ea2dad4027c&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;,
    &lt;span class="pl-ent"&gt;"author"&lt;/span&gt;: {
        &lt;span class="pl-ent"&gt;"role"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;assistant&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;,
        &lt;span class="pl-ent"&gt;"metadata"&lt;/span&gt;: {}
    },
    &lt;span class="pl-ent"&gt;"create_time"&lt;/span&gt;: &lt;span class="pl-c1"&gt;1698340593.174454&lt;/span&gt;,
    &lt;span class="pl-ent"&gt;"content"&lt;/span&gt;: {
        &lt;span class="pl-ent"&gt;"content_type"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;text&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;,
        &lt;span class="pl-ent"&gt;"parts"&lt;/span&gt;: [
            &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;{&lt;span class="pl-cce"&gt;\n&lt;/span&gt;  &lt;span class="pl-cce"&gt;\"&lt;/span&gt;prompts&lt;span class="pl-cce"&gt;\"&lt;/span&gt;: [&lt;span class="pl-cce"&gt;\n&lt;/span&gt;    &lt;span class="pl-cce"&gt;\"&lt;/span&gt;Photo of two Muppet characters: a pelican with a monocle and a bow tie, and a walrus with big, goofy tusks and a dapper bow tie. They're seated in a Muppet-style commentary booth, providing humorous commentary on the Monaco Grand Prix. Cartoonish F1 cars race by, and colorful yachts are seen in the distance.&lt;span class="pl-cce"&gt;\"\n&lt;/span&gt;  ],&lt;span class="pl-cce"&gt;\n&lt;/span&gt;  &lt;span class="pl-cce"&gt;\"&lt;/span&gt;size&lt;span class="pl-cce"&gt;\"&lt;/span&gt;: &lt;span class="pl-cce"&gt;\"&lt;/span&gt;1024x1024&lt;span class="pl-cce"&gt;\"&lt;/span&gt;,&lt;span class="pl-cce"&gt;\n&lt;/span&gt;  &lt;span class="pl-cce"&gt;\"&lt;/span&gt;seeds&lt;span class="pl-cce"&gt;\"&lt;/span&gt;: [1379049893]&lt;span class="pl-cce"&gt;\n&lt;/span&gt;}&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;
        ]
    },
    &lt;span class="pl-ent"&gt;"status"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;finished_successfully&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;,
    &lt;span class="pl-ent"&gt;"end_turn"&lt;/span&gt;: &lt;span class="pl-c1"&gt;false&lt;/span&gt;,
    &lt;span class="pl-ent"&gt;"weight"&lt;/span&gt;: &lt;span class="pl-c1"&gt;1&lt;/span&gt;,
    &lt;span class="pl-ent"&gt;"metadata"&lt;/span&gt;: {
        &lt;span class="pl-ent"&gt;"finish_details"&lt;/span&gt;: {
            &lt;span class="pl-ent"&gt;"type"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;stop&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;,
            &lt;span class="pl-ent"&gt;"stop_tokens"&lt;/span&gt;: [
                &lt;span class="pl-c1"&gt;100265&lt;/span&gt;
            ]
        },
        &lt;span class="pl-ent"&gt;"is_complete"&lt;/span&gt;: &lt;span class="pl-c1"&gt;true&lt;/span&gt;,
        &lt;span class="pl-ent"&gt;"model_slug"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;gpt-4-dalle&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;,
        &lt;span class="pl-ent"&gt;"parent_id"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;aaa2c3bc-b670-4a3a-bf9f-46a1f3304266&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;,
        &lt;span class="pl-ent"&gt;"timestamp_"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;absolute&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;
    },
    &lt;span class="pl-ent"&gt;"recipient"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;dalle.text2im&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note the author is "assistant" - that's ChatGPT - and the recipient is "dalle.text2im".&lt;/p&gt;
&lt;p&gt;The "parts" key includes some encoded JSON. Decoded and pretty-printed that looks like this:&lt;/p&gt;
&lt;div class="highlight highlight-source-json"&gt;&lt;pre style="white-space: pre-wrap"&gt;{
  &lt;span class="pl-ent"&gt;"prompts"&lt;/span&gt;: [
    &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;Photo of two Muppet characters: a pelican with a monocle and a bow tie, and a walrus with big, goofy tusks and a dapper bow tie. They're seated in a Muppet-style commentary booth, providing humorous commentary on the Monaco Grand Prix. Cartoonish F1 cars race by, and colorful yachts are seen in the distance.&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;
  ],
  &lt;span class="pl-ent"&gt;"size"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;1024x1024&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;,
  &lt;span class="pl-ent"&gt;"seeds"&lt;/span&gt;: [&lt;span class="pl-c1"&gt;1379049893&lt;/span&gt;]
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;There's that &lt;code&gt;1379049893&lt;/code&gt; seed from earlier!&lt;/p&gt;
&lt;p&gt;The prompt has changed very slightly. The original prompt for the image was:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Photo of two Muppet characters: a pelican with a monocle and a walrus with big, goofy tusks. They're seated in a Muppet-style commentary booth, providing humorous commentary on the Monaco Grand Prix. Cartoonish F1 cars race by, and colorful yachts are seen in the distance.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The new prompt (differences highlighted in bold) is:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Photo of two Muppet characters: a pelican with a monocle &lt;strong&gt;and a bow tie,&lt;/strong&gt; and a walrus with big, goofy tusks &lt;strong&gt;and a dapper bow tie&lt;/strong&gt;. They're seated in a Muppet-style commentary booth, providing humorous commentary on the Monaco Grand Prix. Cartoonish F1 cars race by, and colorful yachts are seen in the distance.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So this really did work by adding a couple of extra details to the prompt and re-running it with the same seed as before.&lt;/p&gt;
&lt;p&gt;I'm really surprised that this works. I would expect even a single character difference in the prompt to produce wildly different results, no matter what seed was being fed to the image generator. DALL-E 3 doesn't fit my mental model of how these things work at all.&lt;/p&gt;
&lt;p&gt;Midjourney and Stable Diffusion both have a "seed" concept, but as far as I know they don't have anything like this capability to maintain consistency between images given the same seed and a slightly altered prompt.&lt;/p&gt;
&lt;h4 id="the-leaked-dall-e-prompt"&gt;The leaked DALL-E prompt&lt;/h4&gt;
&lt;p&gt;If you dig around in the JSON you'll find a few &lt;a href="https://gist.github.com/simonw/832d141d776b0752503b1748224921c0#file-dalle-3-json-L203"&gt;examples like this&lt;/a&gt; that appear to reveal inner workings of the DALL-E/ChatGPT combo:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;"DALL·E returned some images. They are already displayed to the user. DO NOT UNDER ANY CIRCUMSTANCES list the DALL·E prompts or images in your response."&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It's always amusing to see glimpses of OpenAI's prompt engineering like this, in particular the way they use CAPITAL LETTERS for emphasis. Benj Edwards &lt;a href="https://arstechnica.com/information-technology/2023/10/thanks-to-ai-the-future-of-programming-may-involve-yelling-in-all-caps/"&gt;wrote about this&lt;/a&gt; the other day for Ars Technica.&lt;/p&gt;
&lt;p&gt;Does this mean there's a larger prompt that tells ChatGPT how to use DALL-E? It turns out there is, and it &lt;a href="https://news.ycombinator.com/item?id=37879077#37880847"&gt;can be leaked&lt;/a&gt;! Dustin Miller &lt;a href="https://github.com/spdustin/ChatGPT-AutoExpert/blob/main/_system-prompts/dall-e.md"&gt;shared the extracted prompt here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;(Every time a prompt like this leaks people question if it might be a hallucination. My experience is that these things are very unlikely to be hallucinated - LLMs are really good at repeating text from earlier in their context, and I have yet to see a documented case of a leaked prompt that turned out not to be correct. Here's &lt;a href="https://chat.openai.com/share/5f550be3-3111-485f-a32f-c51fea60d482"&gt;my own recreation&lt;/a&gt; of the leaked DALL-E prompt.)&lt;/p&gt;
&lt;p&gt;There's a lot in there. Here are some highlights:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Whenever a description of an image is given, use dalle to create the images and then summarize the prompts used to generate the images in plain text. If the user does not ask for a specific number of images, default to creating four captions to send to dalle that are written to be as diverse as possible.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That outlines the default behavior. Where things get really interesting is some of the stuff in the list of policies that follows:&lt;/p&gt;
&lt;blockquote&gt;
&lt;ol start="3"&gt;
&lt;li&gt;
&lt;p&gt;Don't create images of politicians or other public figures. Recommend other ideas instead.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Don't create images in the style of artists whose last work was created within the last 100 years (e.g. Picasso, Kahlo). Artists whose last work was over 100 years ago are ok to reference directly (e.g. Van Gogh, Klimt). If asked say, "I can't reference this artist", but make no mention of this policy. Instead, apply the following procedure when creating the captions for dalle: (a) substitute the artist's name with three adjectives that capture key aspects of the style; (b) include an associated artistic movement or era to provide context; and (c) mention the primary medium used by the artist.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;p&gt;They have clearly trained the model on all sorts of copyrighted images - this is the part of the prompt where they discourage it from obviously recreating the work of living artists.&lt;/p&gt;
&lt;blockquote&gt;
&lt;ol start="6"&gt;
&lt;li&gt;Always mention the image type (photo, oil painting, watercolor painting, illustration, cartoon, drawing, vector, render, etc.) at the beginning of the caption. Unless the caption suggests otherwise, make at least 1--2 of the 4 images photos&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;p&gt;We saw this earlier where my first prompt was turned into a photo, watercolor, illustration and vector-style image.&lt;/p&gt;
&lt;blockquote&gt;
&lt;ol start="7"&gt;
&lt;li id="diversify"&gt;Diversify depictions of ALL images with people to include DESCENT and GENDER for EACH person using direct terms. Adjust only human descriptions.
&lt;ul&gt;
&lt;li&gt;EXPLICITLY specify these attributes, not abstractly reference them. The attributes should be specified in a minimal way and should directly describe their physical form.&lt;/li&gt;
&lt;li&gt;Your choices should be grounded in reality. For example, all of a given OCCUPATION should not be the same gender or race. Additionally, focus on creating diverse, inclusive, and exploratory scenes via the properties you choose during rewrites. Make choices that may be insightful or unique sometimes.&lt;/li&gt;
&lt;li&gt;Use "various" or "diverse" ONLY IF the description refers to groups of more than 3 people. Do not change the number of people requested in the original description.&lt;/li&gt;
&lt;li&gt;Don't alter memes, fictional character origins, or unseen people. Maintain the original prompt's intent and prioritize quality.&lt;/li&gt;
&lt;li&gt;Do not create any imagery that would be offensive.&lt;/li&gt;
&lt;li&gt;For scenarios where bias has been traditionally an issue, make sure that key traits such as gender and race are specified and in an unbiased way -- for example, prompts that contain references to specific occupations.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;p&gt;Using prompt engineering in ChatGPT to get around the fundamental biases baked into the DALL-E 3 model!&lt;/p&gt;
&lt;blockquote&gt;
&lt;ol start="8"&gt;
&lt;li&gt;Silently modify descriptions that include names or hints or references of specific people or celebritie by carefully selecting a few minimal modifications to substitute references to the people with generic descriptions that don't divulge any information about their identities, except for their genders and physiques. Do this EVEN WHEN the instructions ask for the prompt to not be changed. Some special cases:
&lt;ul&gt;
&lt;li&gt;Modify such prompts even if you don't know who the person is, or if their name is misspelled (e.g. "Barake Obema")&lt;/li&gt;
&lt;li&gt;If the reference to the person will only appear as TEXT out in the image, then use the reference as is and do not modify it.&lt;/li&gt;
&lt;li&gt;When making the substitutions, don't use prominent titles that could give away the person's identity. E.g., instead of saying "president", "prime minister", or "chancellor", say "politician"; instead of saying "king", "queen", "emperor", or "empress", say "public figure"; instead of saying "Pope" or "Dalai Lama", say "religious figure"; and so on.&lt;/li&gt;
&lt;li&gt;If any creative professional or studio is named, substitute the name with a description of their style that does not reference any specific people, or delete the reference if they are unknown. DO NOT refer to the artist or studio's style.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;p&gt;Another fascinating detail. What I love about these prompts is that they clearly developed over months of testing the model, and are designed to counter all manner of harmful or embarrassing capabilities of the underlying DALL-E 3.&lt;/p&gt;
&lt;p&gt;Finally, there's this snippet of TypeScript at the end which describes the seed behavior we saw earlier on:&lt;/p&gt;
&lt;div class="highlight highlight-source-ts"&gt;&lt;pre style="white-space: pre-wrap"&gt;&lt;span class="pl-k"&gt;namespace&lt;/span&gt; &lt;span class="pl-s1"&gt;dalle&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
&lt;span class="pl-c"&gt;// Create images from a text-only prompt.&lt;/span&gt;
&lt;span class="pl-k"&gt;type&lt;/span&gt; &lt;span class="pl-smi"&gt;text2im&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;_&lt;/span&gt;: &lt;span class="pl-kos"&gt;{&lt;/span&gt;
&lt;span class="pl-c"&gt;// The resolution of the requested image, which can be wide, square, or tall. Use 1024x1024 (square) as the default unless the prompt suggests a wide image, 1792x1024, or a full-body portrait, in which case 1024x1792 (tall) should be used instead. Always include this parameter in the request.&lt;/span&gt;
&lt;span class="pl-c1"&gt;size&lt;/span&gt;?: &lt;span class="pl-s"&gt;"1792x1024"&lt;/span&gt; &lt;span class="pl-c1"&gt;|&lt;/span&gt; &lt;span class="pl-s"&gt;"1024x1024"&lt;/span&gt; &lt;span class="pl-c1"&gt;|&lt;/span&gt; &lt;span class="pl-s"&gt;"1024x1792"&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
&lt;span class="pl-c"&gt;// The user's original image description, potentially modified to abide by the dalle policies. If the user does not suggest a number of captions to create, create four of them. If creating multiple captions, make them as diverse as possible. If the user requested modifications to previous images, the captions should not simply be longer, but rather it should be refactored to integrate the suggestions into each of the captions. Generate no more than 4 images, even if the user requests more.&lt;/span&gt;
&lt;span class="pl-c1"&gt;prompts&lt;/span&gt;: &lt;span class="pl-smi"&gt;string&lt;/span&gt;&lt;span class="pl-kos"&gt;[&lt;/span&gt;&lt;span class="pl-kos"&gt;]&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
&lt;span class="pl-c"&gt;// A list of seeds to use for each prompt. If the user asks to modify a previous image, populate this field with the seed used to generate that image from the image dalle metadata.&lt;/span&gt;
&lt;span class="pl-c1"&gt;seeds&lt;/span&gt;?: &lt;span class="pl-smi"&gt;number&lt;/span&gt;&lt;span class="pl-kos"&gt;[&lt;/span&gt;&lt;span class="pl-kos"&gt;]&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt; &lt;span class="pl-c1"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="pl-smi"&gt;any&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
&lt;span class="pl-kos"&gt;}&lt;/span&gt; &lt;span class="pl-c"&gt;// namespace dalle&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Key extract from that:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;If the user requested
modifications to previous images, the captions should not simply
be longer, but rather it should be refactored to integrate the
suggestions into each of the captions.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;All in all, this is a really neat insight into the kind of prompt engineering that goes on within OpenAI itself - likely the organization with the most experience of prompt engineering in the world.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/ai"&gt;ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/openai"&gt;openai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/dalle"&gt;dalle&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/prompt-engineering"&gt;prompt-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/prompt-injection"&gt;prompt-injection&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generative-ai"&gt;generative-ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/chatgpt"&gt;chatgpt&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/llms"&gt;llms&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/text-to-image"&gt;text-to-image&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="ai"/><category term="openai"/><category term="dalle"/><category term="prompt-engineering"/><category term="prompt-injection"/><category term="generative-ai"/><category term="chatgpt"/><category term="llms"/><category term="text-to-image"/></entry><entry><title>Quoting DALL-E 3 leaked prompt</title><link href="https://simonwillison.net/2023/Oct/7/dall-e-3-prompt/#atom-tag" rel="alternate"/><published>2023-10-07T19:35:09+00:00</published><updated>2023-10-07T19:35:09+00:00</updated><id>https://simonwillison.net/2023/Oct/7/dall-e-3-prompt/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://twitter.com/Suhail/status/1710653717081653712"&gt;&lt;p&gt;&lt;code&gt;Don't create images in the style of artists whose last work was created within the last 100 years (e.g. Picasso, Kahlo). Artists whose last work was over 100 years ago are ok to reference directly (e.g. Van Gogh, Klimt). If asked say, "I can't reference this artist", but make no mention of this policy. Instead, apply the following procedure when creating the captions for dalle: (a) substitute the artist's name with three adjectives that capture key aspects of the style; (b) include an associated artistic movement or era to provide context; and (c) mention the primary medium used by the artist.&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://twitter.com/Suhail/status/1710653717081653712"&gt;DALL-E 3 leaked prompt&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/ai"&gt;ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/openai"&gt;openai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/dalle"&gt;dalle&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/prompt-engineering"&gt;prompt-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/prompt-injection"&gt;prompt-injection&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generative-ai"&gt;generative-ai&lt;/a&gt;&lt;/p&gt;



</summary><category term="ai"/><category term="openai"/><category term="dalle"/><category term="prompt-engineering"/><category term="prompt-injection"/><category term="generative-ai"/></entry><entry><title>Bing Image Creator comes to the new Bing</title><link href="https://simonwillison.net/2023/Mar/21/bing-image-creator-comes-to-the-new-bing/#atom-tag" rel="alternate"/><published>2023-03-21T17:10:53+00:00</published><updated>2023-03-21T17:10:53+00:00</updated><id>https://simonwillison.net/2023/Mar/21/bing-image-creator-comes-to-the-new-bing/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://blogs.microsoft.com/blog/2023/03/21/create-images-with-your-words-bing-image-creator-comes-to-the-new-bing/"&gt;Bing Image Creator comes to the new Bing&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Bing Chat is integrating DALL-E directly into their interface, giving it the ability to generate images when prompted to do so.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/bing"&gt;bing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai"&gt;ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/dalle"&gt;dalle&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generative-ai"&gt;generative-ai&lt;/a&gt;&lt;/p&gt;



</summary><category term="bing"/><category term="ai"/><category term="dalle"/><category term="generative-ai"/></entry><entry><title>The AI that creates any picture you want, explained</title><link href="https://simonwillison.net/2022/Oct/10/vox-ai-images/#atom-tag" rel="alternate"/><published>2022-10-10T03:28:08+00:00</published><updated>2022-10-10T03:28:08+00:00</updated><id>https://simonwillison.net/2022/Oct/10/vox-ai-images/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.youtube.com/watch?v=SVcsDDABEkM"&gt;The AI that creates any picture you want, explained&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Vox made this explainer video about text-to-image generative AI models back in June, months before Stable Diffusion was released and shortly before the DALL-E preview started rolling out to a wider audience. It’s a really good video—in particular the animation that explains at a high level how diffusion models work, which starts about 5m30s in.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/ai"&gt;ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/dalle"&gt;dalle&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/stable-diffusion"&gt;stable-diffusion&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generative-ai"&gt;generative-ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/text-to-image"&gt;text-to-image&lt;/a&gt;&lt;/p&gt;



</summary><category term="ai"/><category term="dalle"/><category term="stable-diffusion"/><category term="generative-ai"/><category term="text-to-image"/></entry><entry><title>Stable Diffusion is a really big deal</title><link href="https://simonwillison.net/2022/Aug/29/stable-diffusion/#atom-tag" rel="alternate"/><published>2022-08-29T01:09:04+00:00</published><updated>2022-08-29T01:09:04+00:00</updated><id>https://simonwillison.net/2022/Aug/29/stable-diffusion/#atom-tag</id><summary type="html">
    &lt;p&gt;If you haven't been paying attention to what's going on with Stable Diffusion, you really should be.&lt;/p&gt;
&lt;p&gt;Stable Diffusion is a new "text-to-image diffusion model" that was &lt;a href="https://stability.ai/blog/stable-diffusion-public-release"&gt;released to the public&lt;/a&gt; by &lt;a href="https://stability.ai/"&gt;Stability.ai&lt;/a&gt; six days ago, on August 22nd.&lt;/p&gt;
&lt;p&gt;It's similar to models like Open AI's DALL-E, but with one crucial difference: they released the whole thing.&lt;/p&gt;
&lt;p&gt;You can try it out online at &lt;a href="https://beta.dreamstudio.ai/"&gt;beta.dreamstudio.ai&lt;/a&gt; (currently for free). Type in a text prompt and the model will generate an image.&lt;/p&gt;
&lt;p&gt;You can download and run the model on your own computer (if you have a powerful enough graphics card). Here's &lt;a href="https://www.reddit.com/r/StableDiffusion/comments/wuyu2u/how_do_i_run_stable_diffusion_and_sharing_faqs/"&gt;an FAQ&lt;/a&gt; on how to do that.&lt;/p&gt;
&lt;p&gt;You can use it for commercial and non-commercial purposes, under the terms of the &lt;a href="https://huggingface.co/spaces/CompVis/stable-diffusion-license"&gt;Creative ML OpenRAIL-M license&lt;/a&gt; - which lists some usage restrictions that include avoiding using it to break applicable laws, generate false information, discriminate against individuals or provide medical advice.&lt;/p&gt;
&lt;p&gt;In just a few days, there has been an &lt;strong&gt;explosion&lt;/strong&gt; of innovation around it. The things people are building are absolutely astonishing.&lt;/p&gt;
&lt;p&gt;I've been tracking the &lt;a href="https://www.reddit.com/r/StableDiffusion/"&gt;r/StableDiffusion&lt;/a&gt; subreddit and following Stability.ai founder &lt;a href="https://twitter.com/EMostaque"&gt;Emad Mostaque&lt;/a&gt; on Twitter.&lt;/p&gt;
&lt;h4&gt;img2img&lt;/h4&gt;
&lt;p&gt;Generating images from text is one thing, but generating images from other images is a whole new ballgame.&lt;/p&gt;
&lt;p&gt;My favourite example so far comes &lt;a href="https://www.reddit.com/r/StableDiffusion/comments/wzlmty/its_some_kind_of_black_magic_i_swear/"&gt;from Reddit user argaman123&lt;/a&gt;. They created this image:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://static.simonwillison.net/static/2022/stable-diffusion-img2img.png" alt="A simple looking Microsoft Paint style image made of flat colours: a sky blue background, a rough yellow desert in the foreground, a semi-circle black line representing a half dome over five shapes in two shades of grey representing buildings inside the dome. A yellow circle represents the sun in the top right of the image, above the dome." style="max-width: 100%;" /&gt;&lt;/p&gt;
&lt;p&gt;And added this prompt (or "&lt;a href="https://www.reddit.com/r/StableDiffusion/comments/wzlmty/comment/im35vwf/?utm_source=reddit&amp;amp;utm_medium=web2x&amp;amp;context=3"&gt;something along those lines&lt;/a&gt;"):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A distant futuristic city full of tall buildings inside a huge transparent glass dome, In the middle of a barren desert full of large dunes, Sun rays, Artstation, Dark sky full of stars with a shiny sun, Massive scale, Fog, Highly detailed, Cinematic, Colorful&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The model produced the following two images:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://static.simonwillison.net/static/2022/stable-diffusion-1.jpg" alt="A gorgeous image of a futuristic city under a glass domb, in front of a wind-swept desert. The composition matches the Microsoft Paint input, but everything is rendered in great detail." style="max-width: 100%;" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://static.simonwillison.net/static/2022/stable-diffusion-2.jpg" alt="A second image, similar to the first but this time the domb is composed of triangle sheets of glass. The composition remains the same." style="max-width: 100%;" /&gt;&lt;/p&gt;
&lt;p&gt;These are amazing. In my &lt;a href="https://simonwillison.net/2022/Jun/23/dall-e/"&gt;previous experiments with DALL-E&lt;/a&gt; I've tried to recreate photographs I have taken, but getting the exact composition I wanted has always proved impossible using just text. With this new capability I feel like I could get the AI to do pretty much exactly what I have in my mind.&lt;/p&gt;
&lt;p&gt;Imagine having an on-demand concept artist that can generate anything you can imagine, and can iterate with you towards your ideal result. For free (or at least for very-cheap).&lt;/p&gt;
&lt;p&gt;You can run this today on your own computer, if you can figure out how to set it up. You can &lt;a href="https://replicate.com/stability-ai/stable-diffusion"&gt;try it in your browser&lt;/a&gt; using Replicate, &lt;a href="https://huggingface.co/spaces/huggingface/diffuse-the-rest"&gt;or Hugging Face&lt;/a&gt;. This capability is apparently coming to the DreamStudio interface &lt;a href="https://twitter.com/EMostaque/status/1563632874091421697"&gt;next week&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There's so much more going on.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/hlky/stable-diffusion-webui"&gt;stable-diffusion-webui&lt;/a&gt; is an open source UI you can run on your own machine providing a powerful interface to the model. &lt;a href="https://twitter.com/altryne/status/1563452692399214594"&gt;Here's a Twitter thread&lt;/a&gt; showing what it can do.&lt;/p&gt;
&lt;p&gt;Reddit user alpacaAI shared &lt;a href="https://old.reddit.com/r/StableDiffusion/comments/wyduk1/show_rstablediffusion_integrating_sd_in_photoshop/"&gt;a video demo&lt;/a&gt; of a Photoshop plugin they are developing which has to be seen to be believed. They have a registration form up on &lt;a href="https://www.getalpaca.io/"&gt;getalpaca.io&lt;/a&gt; for people who want to try it out once it's ready.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://static.simonwillison.net/static/2022/stable-diffusion-alpaca.jpg" alt="A screenshot of Photoshop - a complex image on multiple layers is shown in the background. The user has open a dialog where they have entered the prompt &amp;quot;a dog seating on a path going up in a hill&amp;quot; - with modifiers of &amp;quot;studio ghibli::3&amp;quot;, &amp;quot;highly detailed::1&amp;quot;, &amp;quot;mang anime::1&amp;quot;, &amp;quot;cel-shading::1&amp;quot; and &amp;quot;game characters::1&amp;quot;." style="max-width: 100%;" /&gt;&lt;/p&gt;
&lt;p&gt;Reddit user Hoppss ran a 2D animated clip from Disney's Aladdin through &lt;code&gt;img2img&lt;/code&gt; frame-by frame, using the following parameters:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--prompt "3D render" --strength 0.15 --seed 82345912 --n_samples 1 --ddim_steps 100 --n_iter 1 --scale 30.0 --skip_grid&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The result was &lt;a href="https://www.reddit.com/r/StableDiffusion/comments/wys3w5/applying_img2img_to_video_3d_aladdin/"&gt;a 3D animated video&lt;/a&gt;. Not a great quality one, but pretty stunning for a shell script and a two word prompt!&lt;/p&gt;
&lt;p&gt;The best description I've seen so far of an iterative process to build up an image using Stable Diffusion comes from Andy Salerno: &lt;a href="https://andys.page/posts/how-to-draw/"&gt;4.2 Gigabytes, or: How to Draw Anything&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Ben Firshman has published detailed instructions on how to &lt;a href="https://replicate.com/blog/run-stable-diffusion-on-m1-mac"&gt;Run Stable Diffusion on your M1 Mac’s GPU&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;And there's so much more to come&lt;/h4&gt;
&lt;p&gt;All of this happened in just six days since the model release. Emad Mostaque &lt;a href="https://twitter.com/EMostaque/status/1564011883572633600"&gt;on Twitter&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We use as much compute as stable diffusion used every 36 hours for our upcoming open source models&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This made me think of &lt;a href="https://parti.research.google/"&gt;Google's Parti paper&lt;/a&gt;, which included a demonstration that showed that once the model was trained to 200bn parameters it could generate images with correctly spelled text!&lt;/p&gt;
&lt;p&gt;&lt;img src="https://static.simonwillison.net/static/2022/stable-diffusion-parti.jpg" alt="Four images of a kangaroo holding a sign generated by Parti. In the 350M and 750M parameter images the text on the sign is garbage symbols. At 3B parameters it does at least look like words, but is still not correct. At 20B parametecs the sign reads &amp;quot;Welcome friends&amp;quot;." style="max-width: 100%;" /&gt;&lt;/p&gt;
&lt;h4 id="ai-vegan"&gt;Ethics: will you be an AI vegan?&lt;/h4&gt;
&lt;p&gt;I'm finding the ethics of all of this extremely difficult.&lt;/p&gt;
&lt;p&gt;Stable Diffusion has been trained on millions of copyrighted images scraped from the web.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://github.com/CompVis/stable-diffusion/blob/69ae4b35e0a0f6ee1af8bb9a5d0016ccb27e36dc/Stable_Diffusion_v1_Model_Card.md"&gt;Stable Diffusion v1 Model Card&lt;/a&gt; has the full details, but the short version is that it uses &lt;a href="https://laion.ai/blog/laion-5b/"&gt;LAION-5B&lt;/a&gt; (5.85 billion image-text pairs) and its &lt;a href="https://laion.ai/blog/laion-aesthetics/"&gt;laion-aesthetics v2 5+&lt;/a&gt; subset (which I think is ~600M pairs filtered for aesthetics). These images were scraped from the web.&lt;/p&gt;
&lt;p&gt;I'm not qualified to speak to the legality of this. I'm personally more concerned with the morality.&lt;/p&gt;
&lt;p&gt;The final model is I believe around 4.2GB of data - a binary blob of floating point numbers. The fact that it can compress such an enormous quantity of visual information into such a small space is itself a fascinating detail.&lt;/p&gt;
&lt;p&gt;As such, each image in the training set contributes only a tiny amount of information - a few tweaks to some numeric weights spread across the entire network.&lt;/p&gt;
&lt;p&gt;But... the people who created these images did not give their consent. And the model can be seen as a direct threat to their livelihoods. No-one expected creative AIs to come for the artist jobs first, but here we are!&lt;/p&gt;
&lt;p&gt;I'm still thinking through this, and I'm eager to consume more commentary about it. But my current mental model is to think about this in terms of veganism, as an analogy for people making their own personal ethical decisions.&lt;/p&gt;
&lt;p&gt;I know many vegans. They have access to the same information as I do about the treatment of animals, and they have made informed decisions about their lifestyle, which I fully respect.&lt;/p&gt;
&lt;p&gt;I myself remain a meat-eater.&lt;/p&gt;
&lt;p&gt;There will be many people who will decide that the  AI models trained on copyrighted images are incompatible with their values. I understand and respect that decision.&lt;/p&gt;
&lt;p&gt;But when I look at that img2img example of the futuristic city in the dome, I can't resist imagining what I could do with that capability.&lt;/p&gt;
&lt;p&gt;If someone were to create &lt;a href="https://twitter.com/simonw/status/1563201333821288452"&gt;a vegan model&lt;/a&gt;, trained entirely on out-of-copyright images, I would be delighted to promote it and try it out. If its results were good enough, I might even switch to it entirely.&lt;/p&gt;
&lt;h4&gt;Understanding the training data&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: 30th August 2022. Andy Baio and I worked together on a deep dive into the training data behind Stable Diffusion. Andy wrote up some of our findings in &lt;a href="https://waxy.org/2022/08/exploring-12-million-of-the-images-used-to-train-stable-diffusions-image-generator/"&gt;Exploring 12 Million of the 2.3 Billion Images Used to Train Stable Diffusion’s Image Generator&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;Indistinguishable from magic&lt;/h4&gt;
&lt;p&gt;Just a few months ago, if I'd seen someone on a fictional TV show using an interface like that Photoshop plugin I'd have grumbled about how that was a step too far even by the standards of American network TV dramas.&lt;/p&gt;
&lt;p&gt;Science fiction is real now. Machine learning generative models are here, and the rate with which they are improving is unreal. It's worth paying real attention to what they can do and how they are developing.&lt;/p&gt;
&lt;p&gt;I'm tweeting about this stuff a lot these days. &lt;a href="https://twitter.com/simonw"&gt;Follow @simonw on Twitter&lt;/a&gt; for more.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/ethics"&gt;ethics&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/machine-learning"&gt;machine-learning&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai"&gt;ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/dalle"&gt;dalle&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/stable-diffusion"&gt;stable-diffusion&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/prompt-engineering"&gt;prompt-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generative-ai"&gt;generative-ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/laion"&gt;laion&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/text-to-image"&gt;text-to-image&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai-ethics"&gt;ai-ethics&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="ethics"/><category term="machine-learning"/><category term="ai"/><category term="dalle"/><category term="stable-diffusion"/><category term="prompt-engineering"/><category term="generative-ai"/><category term="laion"/><category term="text-to-image"/><category term="ai-ethics"/></entry><entry><title>Stable Diffusion Public Release</title><link href="https://simonwillison.net/2022/Aug/22/stable-diffusion-public-release/#atom-tag" rel="alternate"/><published>2022-08-22T19:12:43+00:00</published><updated>2022-08-22T19:12:43+00:00</updated><id>https://simonwillison.net/2022/Aug/22/stable-diffusion-public-release/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://stability.ai/blog/stable-diffusion-public-release"&gt;Stable Diffusion Public Release&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
New AI just dropped. Stable Diffusion is similar to DALL-E, but completely open source and with a CC0 license applied to everything it generates. I have a Twitter thread (the via) link of comparisons I’ve made between its output and my previous DALL-E experiments. The announcement buries the lede somewhat: to try it out, visit beta.dreamstudio.ai—which you can use for free at the moment, but it’s unclear to me how billing is supposed to work.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/simonw/status/1561780550825783296"&gt;@simonw&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/machine-learning"&gt;machine-learning&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/dalle"&gt;dalle&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/stable-diffusion"&gt;stable-diffusion&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generative-ai"&gt;generative-ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/text-to-image"&gt;text-to-image&lt;/a&gt;&lt;/p&gt;



</summary><category term="machine-learning"/><category term="dalle"/><category term="stable-diffusion"/><category term="generative-ai"/><category term="text-to-image"/></entry><entry><title>Litestream backups for Datasette Cloud (and weeknotes)</title><link href="https://simonwillison.net/2022/Aug/11/litestream-backups/#atom-tag" rel="alternate"/><published>2022-08-11T17:19:52+00:00</published><updated>2022-08-11T17:19:52+00:00</updated><id>https://simonwillison.net/2022/Aug/11/litestream-backups/#atom-tag</id><summary type="html">
    &lt;p&gt;My main focus this week has been adding robust backups to the forthcoming Datasette Cloud.&lt;/p&gt;
&lt;p&gt;Datasette Cloud is a SaaS service for &lt;a href="https://datasette.io"&gt;Datasette&lt;/a&gt;. It allows people to create a private Datasette instance where they can upload data, visualize and transform it and share it with other members of their team. You can join the waiting list to try it out using &lt;a href="https://docs.google.com/forms/d/e/1FAIpQLSeMRYHBHXlWGDkjCqhAOinDrKEVwqNR5GfPs3iEXn8LzDT2Qg/viewform?embedded=true"&gt;this form&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I'm building Datastte Cloud on &lt;a href="https://fly.io/"&gt;Fly&lt;/a&gt;, specifically on &lt;a href="https://fly.io/blog/fly-machines/"&gt;Fly Machines&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Security is a big concern for Datasette Cloud. Teams should only be able to access their own data - bugs where users accidentally (or maliciously) access data for another team should be protected against as much as possible.&lt;/p&gt;
&lt;p&gt;To help guarantee that, I've designed Datasette Cloud so that each team gets their own, dedicated instance, running in a &lt;a href="https://firecracker-microvm.github.io/"&gt;Firecracker VM&lt;/a&gt; managed by Fly. Their data lives in a dedicated volume.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://fly.io/docs/reference/volumes/"&gt;Fly volumes&lt;/a&gt; already implement snapshot backups, but I'm interested in defence in depth. This is where &lt;a href="https://litestream.io/"&gt;Litestream&lt;/a&gt; comes in (coincidentally now &lt;a href="https://fly.io/blog/all-in-on-sqlite-litestream/"&gt;part of Fly&lt;/a&gt;, although it wasn't when I first selected it as my backup strategy).&lt;/p&gt;
&lt;p&gt;I'm using Litestream to constantly backup the data for each Datasette Cloud team to an S3 bucket. In the case of a complete failure of a volume, I can restore data from a backup that should be at most a few seconds out of date. Litestream also gives me point-in-time backups, such that I can recover a previous version of the data within a configurable retention window.&lt;/p&gt;
&lt;h4&gt;Keeping backups isolated&lt;/h4&gt;
&lt;p&gt;Litestream &lt;a href="https://litestream.io/how-it-works/"&gt;works&lt;/a&gt; by writing a constant stream of pages from SQLite's WAL (Write-Ahead Log) up to an S3 bucket. It needs the ability to both read and write from S3.&lt;/p&gt;
&lt;p&gt;This requires making S3 credentials available within the containers that run Datasette and Litestream for each team account.&lt;/p&gt;
&lt;p&gt;Credentials in those containers are not visible to the users of the software, but I still wanted to be confident that if the credentials leaked in some way the isolation between teams would be maintained.&lt;/p&gt;
&lt;p&gt;Initially I thought about having a separate S3 bucket for each team, but it turns out AWS has a default limit of 100 buckets per account, and a hard limit of 1,000. I aspire to have more than 1,000 customers, so this limit makes a bucket-per-team seem like the wrong solution.&lt;/p&gt;
&lt;p&gt;I've learned an absolute ton about S3 and AWS permissions building my &lt;a href="https://github.com/simonw/s3-credentials"&gt;s3-credentials&lt;/a&gt; tool for creating credentials for accessing S3.&lt;/p&gt;
&lt;p&gt;One of the tricks I've learned is that it's possible to create temporary, time-limited credentials that &lt;a href="https://simonwillison.net/2022/Jan/18/weeknotes/"&gt;only work for a prefix&lt;/a&gt; (effectively a folder) within an S3 bucket.&lt;/p&gt;
&lt;p&gt;This means I can run Litestream with credentials that are specific to the team - that can read and write only from the &lt;code&gt;team-ID/&lt;/code&gt; prefix in the S3 bucket I am using to store the backups.&lt;/p&gt;
&lt;h4&gt;Obtaining temporary credentials&lt;/h4&gt;
&lt;p&gt;My &lt;code&gt;s3-credentials&lt;/code&gt; tool can create credentials for a prefix within an S3 bucket like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;s3-credentials create my-bucket-for-backus \
  --duration 12h \
  --prefix team-56/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command uses the &lt;a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sts.html#STS.Client.assume_role"&gt;sts.assume_role()&lt;/a&gt; AWS method to create credentials that allow access to that bucket, attaching &lt;a href="https://github.com/simonw/s3-credentials/blob/0.12.1/README.md#--prefix-my-prefix"&gt;this generated JSON policy&lt;/a&gt; to it in order to restrict access to the provided prefix.&lt;/p&gt;
&lt;p&gt;I extracted the relevant Python code from  &lt;code&gt;s3-credentials&lt;/code&gt; and used it to create a private API endpoint in my Datasette Cloud management server which could return the temporary credentials needed by the team container.&lt;/p&gt;
&lt;p&gt;With the endpoint in place, my code for launching a team container can do this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create the volume and machine for that team (if they do not yet exist)&lt;/li&gt;
&lt;li&gt;Generate a signed secret token that the machine container can exchange for its S3 credentials&lt;/li&gt;
&lt;li&gt;Launch the machine container, passing it the secret token&lt;/li&gt;
&lt;li&gt;On launch, the container runs a script which exchanges that secret token for its 12 hour S3 credentials, using the private API endpoint I created&lt;/li&gt;
&lt;li&gt;Those credentials are used to populate the &lt;code&gt;AWS_ACCESS_KEY_ID&lt;/code&gt;, &lt;code&gt;AWS_SECRET_ACCESS_KEY&lt;/code&gt; and &lt;code&gt;AWS_SESSION_TOKEN&lt;/code&gt; environment variables used by Litestream&lt;/li&gt;
&lt;li&gt;Start Litestream, which then starts Datasette&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Restarting every 12 hours&lt;/h4&gt;
&lt;p&gt;You may be wondering why I bothered with that initial secret token - why not just pass the temporary AWS credentials to the container when I launch it?&lt;/p&gt;
&lt;p&gt;The reason for this is that I need to be able to obtain fresh credentials every 12 hours.&lt;/p&gt;
&lt;p&gt;A really neat feature of Fly Machines is that they support scale-to-zero. You can stop them, and Fly will automatically restart them the next time they recieve traffic.&lt;/p&gt;
&lt;p&gt;All you need to do is call &lt;code&gt;sys.exit(0)&lt;/code&gt; in your Python code (or the equivalent in any other language) and Fly will stop your container... and then restart it again with a couple of seconds of cold start time the next time an HTTP request for your container hits the Fly router.&lt;/p&gt;
&lt;p&gt;So far I'm mainly using this to avoid the cost of running containers when they aren't actually in- use. But there's a neat benefit when it comes to Litestream too.&lt;/p&gt;
&lt;p&gt;I'm using S3 credentials which expire after 12 hours. This means I need to periodically refresh the credentials and restart Litestream or it will stop being able to write to the S3 bucket.&lt;/p&gt;
&lt;p&gt;After considering a few ways of doing this, I selected the simplest to implement: have Datasette call &lt;code&gt;sys.exit(0)&lt;/code&gt; after ten hours, and let Fly restart the container causing my startup script to fetch freshly generated 12 hour credentials and pass them to Litestream.&lt;/p&gt;
&lt;p&gt;I implemented this by adding it as a new setting to my existing &lt;a href="https://datasette.io/plugins/datasette-scale-to-zero"&gt;datasette-scale-to-zero&lt;/a&gt; plugin. You can now configure that with &lt;code&gt; "max-age": "10h"&lt;/code&gt; and it will shut down Datasette once the server has been running for that long.&lt;/p&gt;
&lt;p&gt;Why does this require my own secret token system? Because when the container is restarted, it needs to make an authenticated call to my endpoint to retrieve those fresh S3 credentials. Fly persists environment variable secrets between restarts to the container, so that secret can be long-lived even while it is exchanged for short-term S3 credentials.&lt;/p&gt;
&lt;p&gt;I only just put the new backup system in place, so I'm exercising it a bit before I open things up to trial users - but so far it's looking like a very robust solution to the problem.&lt;/p&gt;
&lt;h4&gt;s3-ocr improvements&lt;/h4&gt;
&lt;p&gt;I released a &lt;a href="https://datasette.io/tools/s3-ocr"&gt;few new versions&lt;/a&gt; of &lt;a href="https://simonwillison.net/2022/Jun/30/s3-ocr/"&gt;s3-ocr&lt;/a&gt; this week, as part of my ongoing project working with the San Francisco Microscopical Society team to release a searchable version of their scanned document archives.&lt;/p&gt;
&lt;p&gt;The two main improvements are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A new &lt;code&gt;--dry-run&lt;/code&gt; option to &lt;code&gt;s3-ocr start&lt;/code&gt; which shows you what the tool will do without making any changes to your S3 bucket, or triggering any OCR jobs. &lt;a href="https://github.com/simonw/s3-ocr/issues/22"&gt;#22&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;s3-ocr start&lt;/code&gt; used to fail with an error if running it would create more than 100 (or 600 depending on your region) concurrent OCR jobs. The tool now knows how to identify that error and pause and retry starting the jobs instead. &lt;a href="https://github.com/simonw/s3-ocr/issues/21"&gt;#21&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The fix that took the most time is this: installations of the tool no longer arbitrarily fail to work depending on the environment you install them into!&lt;/p&gt;
&lt;p&gt;Solving this took me the best part of a day. The short version is this: Click 8.1.0 introduced a new feature that lets you use &lt;code&gt;@cli.command&lt;/code&gt; as a decorator instead of &lt;code&gt;@cli.command()&lt;/code&gt;. This meant that installing &lt;code&gt;s3-ocr&lt;/code&gt; in an environment that already had a previous version of Click would result in silent errors.&lt;/p&gt;
&lt;p&gt;The solution is simple: pin to &lt;code&gt;click&amp;gt;=8.1.0&lt;/code&gt; in the project dependencies if you plan to use this new syntax.&lt;/p&gt;
&lt;p&gt;If I'd read the Click &lt;a href="https://click.palletsprojects.com/en/8.1.x/changes/#version-8-1-0"&gt;changelog more closely&lt;/a&gt; I would have saved myself a whole lot of time.&lt;/p&gt;
&lt;p&gt;Issues &lt;a href="https://github.com/simonw/s3-ocr/issues/25"&gt;#25&lt;/a&gt; and &lt;a href="https://github.com/simonw/s3-ocr/issues/26"&gt;#26&lt;/a&gt; detail the many false turns I took trying to figure this out.&lt;/p&gt;
&lt;h4&gt;More fun with GPT-3 and DALL-E&lt;/h4&gt;
&lt;p&gt;This tweet scored over a million impressions on Twitter:&lt;/p&gt;

&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;New hobby: prototyping video games in 60 seconds using a combination of GPT-3 and DALL-E&lt;br /&gt;&lt;br /&gt;Here&amp;#39;s &amp;quot;Raccoon Heist&amp;quot; &lt;a href="https://t.co/xQ3Vm8p2XW"&gt;pic.twitter.com/xQ3Vm8p2XW&lt;/a&gt;&lt;/p&gt;- Simon Willison (@simonw) &lt;a href="https://twitter.com/simonw/status/1555626060384911360?ref_src=twsrc%5Etfw"&gt;August 5, 2022&lt;/a&gt;&lt;/blockquote&gt;

&lt;p&gt;As this got retweeted outside of my usual circles it started confusing people who thought the "prototype" was a working game, as opposed to a fake screenshot and a paragraph of descriptive text! I wasn't kidding when I said I spent 60 seconds on this.&lt;/p&gt;
&lt;p&gt;I also figured out how to use GPT-3 to write &lt;code&gt;jq&lt;/code&gt; one-liners. I love &lt;code&gt;jq&lt;/code&gt; but I have to look up how to use it every time, so having GPT-3 do the work for me is a pretty neat time saver. More on that in this TIL: &lt;a href="https://til.simonwillison.net/gpt3/jq"&gt;Using GPT-3 to figure out jq recipes&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Releases this week&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/s3-ocr"&gt;s3-ocr&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/s3-ocr/releases/tag/0.6.3"&gt;0.6.3&lt;/a&gt; - (&lt;a href="https://github.com/simonw/s3-ocr/releases"&gt;9 releases total&lt;/a&gt;) - 2022-08-10
&lt;br /&gt;Tools for running OCR against files stored in S3&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/datasette-scale-to-zero"&gt;datasette-scale-to-zero&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/datasette-scale-to-zero/releases/tag/0.2"&gt;0.2&lt;/a&gt; - (&lt;a href="https://github.com/simonw/datasette-scale-to-zero/releases"&gt;4 releases total&lt;/a&gt;) - 2022-08-05
&lt;br /&gt;Quit Datasette if it has not received traffic for a specified time period&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/shot-scraper"&gt;shot-scraper&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/shot-scraper/releases/tag/0.14.3"&gt;0.14.3&lt;/a&gt; - (&lt;a href="https://github.com/simonw/shot-scraper/releases"&gt;18 releases total&lt;/a&gt;) - 2022-08-02
&lt;br /&gt;A command-line utility for taking automated screenshots of websites&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/s3-credentials"&gt;s3-credentials&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/s3-credentials/releases/tag/0.12.1"&gt;0.12.1&lt;/a&gt; - (&lt;a href="https://github.com/simonw/s3-credentials/releases"&gt;13 releases total&lt;/a&gt;) - 2022-08-01
&lt;br /&gt;A tool for creating credentials for accessing S3 buckets&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/datasette-sqlite-fts4"&gt;datasette-sqlite-fts4&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/datasette-sqlite-fts4/releases/tag/0.3.2"&gt;0.3.2&lt;/a&gt; - (&lt;a href="https://github.com/simonw/datasette-sqlite-fts4/releases"&gt;2 releases total&lt;/a&gt;) - 2022-07-31&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;TIL this week&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://til.simonwillison.net/sqlite/related-content"&gt;Related content with SQLite FTS and a Datasette template function&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://til.simonwillison.net/aws/boto-command-line"&gt;Using boto3 from the command line&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://til.simonwillison.net/sqlite/trying-macos-extensions"&gt;Trying out SQLite extensions on macOS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://til.simonwillison.net/pytest/mocking-boto"&gt;Mocking a Textract LimitExceededException with boto&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://til.simonwillison.net/gpt3/jq"&gt;Using GPT-3 to figure out jq recipes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/ocr"&gt;ocr&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/s3"&gt;s3&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/datasette"&gt;datasette&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/weeknotes"&gt;weeknotes&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/datasette-cloud"&gt;datasette-cloud&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/fly"&gt;fly&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/litestream"&gt;litestream&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/gpt-3"&gt;gpt-3&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/dalle"&gt;dalle&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="ocr"/><category term="s3"/><category term="datasette"/><category term="weeknotes"/><category term="datasette-cloud"/><category term="fly"/><category term="litestream"/><category term="gpt-3"/><category term="dalle"/></entry><entry><title>How I Used DALL·E 2 to Generate The Logo for OctoSQL</title><link href="https://simonwillison.net/2022/Aug/2/how-i-used-dalle-2-to-generate-the-logo-for-octosql/#atom-tag" rel="alternate"/><published>2022-08-02T21:12:46+00:00</published><updated>2022-08-02T21:12:46+00:00</updated><id>https://simonwillison.net/2022/Aug/2/how-i-used-dalle-2-to-generate-the-logo-for-octosql/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://jacobmartins.com/posts/how-i-used-dalle2-to-generate-the-logo-for-octosql/"&gt;How I Used DALL·E 2 to Generate The Logo for OctoSQL&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Jacob Martin gives a blow-by-blow account of his attempts at creating a logo for his OctoSQL project using DALL-E, spending $30 of credits and making extensive use of both the “variations” feature and the tool that lets you request modifications to existing images by painting over parts you want to regenerate. Really interesting to read as an example of a “real world” DALL-E project.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=32320491"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/openai"&gt;openai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/dalle"&gt;dalle&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generative-ai"&gt;generative-ai&lt;/a&gt;&lt;/p&gt;



</summary><category term="openai"/><category term="dalle"/><category term="generative-ai"/></entry><entry><title>The DALL·E 2 Prompt Book</title><link href="https://simonwillison.net/2022/Jul/14/the-dalle-2-prompt-book/#atom-tag" rel="alternate"/><published>2022-07-14T23:26:55+00:00</published><updated>2022-07-14T23:26:55+00:00</updated><id>https://simonwillison.net/2022/Jul/14/the-dalle-2-prompt-book/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://dallery.gallery/the-dalle-2-prompt-book/"&gt;The DALL·E 2 Prompt Book&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
This is effectively DALL-E: The Missing Manual: an 81 page PDF book that goes into exhaustive detail about how to get the most out of DALL-E through creative prompt design.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=32088718"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/ai"&gt;ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/openai"&gt;openai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/dalle"&gt;dalle&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/prompt-engineering"&gt;prompt-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generative-ai"&gt;generative-ai&lt;/a&gt;&lt;/p&gt;



</summary><category term="ai"/><category term="openai"/><category term="dalle"/><category term="prompt-engineering"/><category term="generative-ai"/></entry><entry><title>First impressions of DALL-E, generating images from text</title><link href="https://simonwillison.net/2022/Jun/23/dall-e/#atom-tag" rel="alternate"/><published>2022-06-23T23:05:56+00:00</published><updated>2022-06-23T23:05:56+00:00</updated><id>https://simonwillison.net/2022/Jun/23/dall-e/#atom-tag</id><summary type="html">
    &lt;p&gt;I made it off the &lt;a href="https://labs.openai.com/waitlist"&gt;DALL-E waiting list&lt;/a&gt; a few days ago and I've been having an enormous amount of fun experimenting with it. Here are some notes on what I've learned so far (and a bunch of example images too).&lt;/p&gt;
&lt;p&gt;(For those not familiar with it, &lt;a href="https://openai.com/blog/dall-e/"&gt;DALL-E&lt;/a&gt; is OpenAI's advanced text-to-image generator: you feed it a prompt, it generates images. It's extraordinarily good at it.)&lt;/p&gt;
&lt;p&gt;First, a warning: DALL-E only allows you to generate up to 50 images a day. I found this out only when I tried to generate image number 51. So there's a budget to watch out for.&lt;/p&gt;
&lt;p&gt;I've usually run out by lunch time!&lt;/p&gt;
&lt;h4&gt;How to use DALL-E&lt;/h4&gt;
&lt;p&gt;DALL-E is even simpler to use &lt;a href="https://simonwillison.net/2022/Jun/5/play-with-gpt3/"&gt;than GPT-3&lt;/a&gt;: you get a text box to type in, and that's it. There are no advanced settings to tweak.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-interface-2.png" alt="A label says &amp;quot;Start with a detailed description&amp;quot; - there is also a &amp;quot;Surprise me&amp;quot; button. The text box has the grayed out suggestion text &amp;quot;An impressionist oil painting of sunflowers in a puple vase.&amp;quot; There is also a Generate button, and the text &amp;quot;Or upload an image to edit&amp;quot;" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;It does have one other mode: you can upload your own photo, crop it to a square and then erase portions of it and ask DALL-E to fill them in with a prompt. This feature is clearly still in the early stages - I've not had great results with it yet.&lt;/p&gt;
&lt;p&gt;DALL-E always returns six resulting images, which I believe it has selected as the "best" from hundreds of potential results.&lt;/p&gt;
&lt;h4&gt;Tips on prompts&lt;/h4&gt;
&lt;p&gt;DALL-E's initial label suggests to "Start with a detailed description". This is very good advice!&lt;/p&gt;
&lt;p&gt;The more detail you provide, the more interesting DALL-E gets.&lt;/p&gt;
&lt;p&gt;If you type "Pelican", you'll get an image that is indistinguishable from what you might get from something like Google Image search. But the more details you ask for, the more interesting and fun the result.&lt;/p&gt;
&lt;h4&gt;Fun with pelicans&lt;/h4&gt;
&lt;p&gt;Here's "A ceramic pelican in a Mexican folk art style with a big cactus growing out of it":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-pelican-cactus.jpg" alt="A ceramic pelican in a Mexican folk art style with a big cactus growing out of it - the image looks exactly like that, it's very impressive" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;Some of the most fun results you can have come from providing hints as to a medium or art style you would like. Here's "A heavy metal album cover where the band members are all pelicans... made of lightning":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-pelican-album-cover.jpg" alt="A heavy metal album cover where the band members are all pelicans... made of lightning - except none of the pelicans are made of lightning. The text at the top reads PLENY HLAN" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;This illustrates a few interesting points. Firstly, DALL-E is hilariously bad at any images involving text. It can make things that look like letters and words but it has no concept of actual writing.&lt;/p&gt;
&lt;p&gt;My initial prompt was for "A death metal album cover..." - but DALL-E refused to generate that. It has a filter to prevent people from generating images that go outside its &lt;a href="https://labs.openai.com/policies/content-policy"&gt;content policy&lt;/a&gt;, and the word "death" triggered it.&lt;/p&gt;
&lt;p&gt;(I'm confident that the filter can be easily avoided, but I don't want to have my access revoked so I haven't spent any time pushing its limits.)&lt;/p&gt;
&lt;p&gt;It's also not a great result - those pelicans are not made of lightning! I tried a tweaked prompt:&lt;/p&gt;
&lt;p&gt;"A heavy metal album cover where the band members are all pelicans that are made of lightning":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-pelican-album-cover-six.jpg" alt="A heavy metal album cover where the band members are all pelicans that are made of lightning - six images, all very heavy metal but none of them where the birds are made of lightning, though two have lightning in the background now" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;Still not made of lightning. One more try:&lt;/p&gt;
&lt;p&gt;"pelican made of lightning":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-pelicans-made-of-lightning.jpg" alt="Six images of pelicans - they are all made of lightning this time, but they don't look great." style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;Let's try the universal DALL-E cheat code, adding "digital art" to the prompt.&lt;/p&gt;
&lt;p&gt;"a pelican made of lightning, digital art"&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-pelicans-made-of-lightning-digital-art.jpg" alt="Six images of pelicans - they are all made of lightning this time, and they look pretty cool" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;OK, those look a lot better!&lt;/p&gt;
&lt;p&gt;One last try - the earlier prompt but with "digital art" added.&lt;/p&gt;
&lt;p&gt;"A heavy metal album cover where the band members are all pelicans that are made of lightning, digital art":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-pelicans-album-digital-art.jpg" alt="These are really cool images of pelicans with lightning - though again, they aren't really made of lightning. Also there's no album text any more." style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;OK, these are cool. The text is gone - maybe the "digital art" influence over-rode the "album cover" a tiny bit there.&lt;/p&gt;
&lt;p&gt;This process is a good example of "prompt engineering" - feeding in altered prompts to try to iterate towards a better result. This is a very deep topic, and I'm confident I've only just scratched the surface of it.&lt;/p&gt;
&lt;p&gt;Breaking away from album art, here's "A squadron of pelicans having a tea party in a forest with a raccoon, digital art". Often when you specify "digital art" it picks some other additional medium:&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-pelican-tea-party.jpg" alt="A beautiful painting. A racoon sits in the foreground at a little table in the forest. He is surrounded by pelicans, one of which is pouring a drink from a half-bucket-half-teapot." style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;h4&gt;Recreating things you see&lt;/h4&gt;
&lt;p&gt;A fun game I started to play with DALL-E was to see if I could get it to recreate things I saw in real life.&lt;/p&gt;
&lt;p&gt;My dog, Cleo, was woofing at me for breakfast. I took this photo of her:&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/cleo-sitting.jpg" alt="A medium sized black pitbull mix sitting on a hardwood floor" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;Then I tried this prompt: "A medium sized black dog who is a pit bull mix sitting on the ground wagging her tail and woofing at me on a hardwood floor"&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-cleo-sitting.jpg" alt="A medium sized black pitbull mix sitting on a hardwood floor" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;OK, wow.&lt;/p&gt;
&lt;p&gt;Later, I caught her napping on the bed:&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/cleo-napping.jpg" alt="A medium sized black pitbull mix curled up asleep on a green duvet" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;Here's DALL-E for "A medium sized black pit bull mix curled up asleep on a dark green duvet cover":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-cleo-napping-bed.jpg" alt="A medium sized black pit bull mix curled up asleep on a dark green duvet cover - a very good image" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;One more go at that. Our chicken Cardi snuck into the house and snuggled up on the sofa. Before I evicted her back into the garden I took this photo:&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/chicken-sofa.jpg" alt="a black and white speckled chicken with a red comb snuggled on a blue sofa next to a cushion with a blue seal pattern and a blue and white knitted blanket" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;"a black and white speckled chicken with a red comb snuggled on a blue sofa next to a cushion with a blue seal pattern and a blue and white knitted blanket":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-chicken-sofa.jpg" alt="Six images that fit the brief, though the cushions don't have the pattern and the camera zoomed in much closer on the chicken than in the original" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;Clearly I didn't provide a detailed enough prompt here! I would need to iterate on this one a lot.&lt;/p&gt;
&lt;h4&gt;Stained glass&lt;/h4&gt;
&lt;p&gt;DALL-E is great at stained glass windows.&lt;/p&gt;
&lt;p&gt;"Pelican in a waistcoat as a stained glass window":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-stained-glass-pelican.jpg" alt="A really cool stained glass window design of a pelican, though it is not wearing a waistcoat" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;"A stained glass window depicting 5 different &lt;a href="https://en.wikipedia.org/wiki/Nudibranch"&gt;nudibranchs&lt;/a&gt;"&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-stained-glass-nudibranchs.jpg" alt="5 different nudibranchs in stained glass - really good" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;h4&gt;People&lt;/h4&gt;
&lt;p&gt;DALL-E is (understandably) quite careful about depictions of people. It won't let you upload images with recognisable faces in them, and when you ask for a prompt with a famous person it will sometimes pull off tricks like showing them from behind.&lt;/p&gt;
&lt;p&gt;Here's "The pope on a bicycle leading a bicycle race through Paris":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-pope.jpg" alt="A photo of the pope on a bicycle, taken from behind, with a blurred out Paris street in the background" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;Though maybe it was the "leading a bicycle race" part that inspired it to draw the image from this direction? I'm not sure.&lt;/p&gt;
&lt;p&gt;It will sometimes generate made-up people with visible faces, but they &lt;a href="https://openai.com/blog/dall-e-2-update/"&gt;ask users not to share those images&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;Assorted images&lt;/h4&gt;
&lt;p&gt;Here are a bunch of images that I liked, with their prompts.&lt;/p&gt;
&lt;p&gt;Inspired by one of our chickens:&lt;/p&gt;
&lt;p&gt;"A blue-grey fluffy chicken puffed up and looking angry perched under a lemon tree"&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-chicken.jpg" alt="A blue-grey fluffy chicken puffed up and looking angry perched under a lemon tree" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;I asked it for the same thing, painted by Salvador Dali:&lt;/p&gt;
&lt;p&gt;"A blue-grey fluffy chicken puffed up and looking angry perched under a lemon tree, painted by Salvador Dali":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-dali-chickens.jpg" alt="Three paintings of a blue-grey fluffy chicken puffed up and looking angry perched under a lemon tree, in the style of Salvador Dali" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;"Bats having a quinceañera, digital art":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-bats.jpg" alt="Three bats with pink ears, one is wearing a pink dress" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;"The scene in an Agatha Christie mystery where the e detective reveals who did it, but everyone is a raccoon. Digital art.":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-agatha-christie.jpg" alt="This one is in more of a cartoon style. The raccoon stands in front, and four people in period clothes stand in the background, one of them with a magnifying glass." style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;(It didn't make everyone a raccoon. It also refused my initial prompt where I asked for an Agatha Christie murder mystery, presumably because of the word "murder".)&lt;/p&gt;
&lt;p&gt;"An acoustic guitar decorated with capybaras in Mexican folk art style, sigma 85mm":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-guitar.jpg" alt="A close-up shot of an acoustic guitar with some capybaras painted on it." style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;Adding "sigma 85mm" (and various other mm lengths) is a trick I picked up which gives you realistic images that tend to be cropped well.&lt;/p&gt;
&lt;p&gt;"A raccoon wearing glasses and reading a poem at a poetry evening, sigma 35mm":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-racoon-poetry.jpg" alt="A very convincing photograph of a racoon wearing glasses reading from a book, with a blurry background" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;"Pencil sketch of a Squirrel reading a book":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-pencil-squirrel.jpg" alt="A just gorgeous pencil sketch of a squirrel reading a book" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;Pencil sketches come out fantastically well.&lt;/p&gt;
&lt;p&gt;"The royal pavilion in brighton covered in snow"&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-pavillion-snow.jpg" alt="The royal pavilion in brighton covered in snow - the windows look a bit weird" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;I experienced this once, many years ago when I lived in Brighton - but forgot to take a photo of it. It looked exactly like this.&lt;/p&gt;
&lt;h4 id="fantasy-breakfast-tacos"&gt;And a game: fantasy breakfast tacos&lt;/h4&gt;
&lt;p&gt;It's difficult to overstate how much fun playing with this stuff is. Here's a game I came up with: fantasy breakfast tacos. See how tasty a taco you can invent!&lt;/p&gt;
&lt;p&gt;Mine was "breakfast tacos with lobster, steak, salmon, sausages and three different sauces":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-meat-taco.jpg" alt="A really delicious assortment of tacos" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;Natalie is a vegetarian, which I think puts her at a disadvantage in this game. "breakfast taco containing cauliflower, cheesecake, tomatoes, eggs, flowers":&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://static.simonwillison.net/static/2022/dall-e-veggie-taco.jpg" alt="A really delicious assortment of tacos" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;h4&gt;Closing thoughts&lt;/h4&gt;
&lt;p&gt;As you can see, I have been enjoying playing with this a LOT. I could easily share twice as much - the above are just the highlights from my experiments so far.&lt;/p&gt;
&lt;p&gt;The obvious question raised by this is how it will affect people who generate art and design for a living. I don't have anything useful to say about that, other than recommending that they make themselves familiar with the capabilities of these kinds of tools - which have taken an astonishing leap forward in the past few years.&lt;/p&gt;
&lt;p&gt;My current mental model of DALL-E is that it's a fascinating tool for enhancing my imagination. Being able to imagine something and see it visualized a few seconds later is an extraordinary new ability.&lt;/p&gt;
&lt;p&gt;I haven't yet figured out how to apply this to real world problems that I face - my attempts at getting DALL-E to generate website wireframes or explanatory illustrations have been unusable so far - but I'll keep on experimenting with it. Especially since feeding it prompts is just so much fun.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/machine-learning"&gt;machine-learning&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai"&gt;ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/openai"&gt;openai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/dalle"&gt;dalle&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/prompt-engineering"&gt;prompt-engineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generative-ai"&gt;generative-ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/text-to-image"&gt;text-to-image&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="machine-learning"/><category term="ai"/><category term="openai"/><category term="dalle"/><category term="prompt-engineering"/><category term="generative-ai"/><category term="text-to-image"/></entry><entry><title>How Imagen Actually Works</title><link href="https://simonwillison.net/2022/Jun/23/how-imagen-actually-works/#atom-tag" rel="alternate"/><published>2022-06-23T18:05:58+00:00</published><updated>2022-06-23T18:05:58+00:00</updated><id>https://simonwillison.net/2022/Jun/23/how-imagen-actually-works/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.assemblyai.com/blog/how-imagen-actually-works/"&gt;How Imagen Actually Works&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Imagen is Google’s new text-to-image model, similar to (but possibly even more effective than) DALL-E. This article is the clearest explanation I’ve seen of how Imagen works: it uses Google’s existing T5 text encoder to convert the input sentence into an encoding that captures the semantic meaning of the sentence (including things like items being described as being on top of other items), then uses a trained diffusion model to generate a 64x64 image. That image is passed through two super-res models to increase the resolution to the final 1024x1024 output.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/google"&gt;google&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/machine-learning"&gt;machine-learning&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai"&gt;ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/dalle"&gt;dalle&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generative-ai"&gt;generative-ai&lt;/a&gt;&lt;/p&gt;



</summary><category term="google"/><category term="machine-learning"/><category term="ai"/><category term="dalle"/><category term="generative-ai"/></entry><entry><title>DALL·E: Creating Images from Text</title><link href="https://simonwillison.net/2021/Jan/5/dalle-creating-images-from-text/#atom-tag" rel="alternate"/><published>2021-01-05T20:31:49+00:00</published><updated>2021-01-05T20:31:49+00:00</updated><id>https://simonwillison.net/2021/Jan/5/dalle-creating-images-from-text/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://openai.com/blog/dall-e/"&gt;DALL·E: Creating Images from Text&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
“DALL·E is a 12-billion parameter version of GPT-3 trained to generate images from text descriptions, using a dataset of text–image pairs.”. The examples in this paper are astonishing—“an illustration of a baby daikon radish in a tutu walking a dog” generates exactly that.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=25649557"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/machine-learning"&gt;machine-learning&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai"&gt;ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/openai"&gt;openai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/dalle"&gt;dalle&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generative-ai"&gt;generative-ai&lt;/a&gt;&lt;/p&gt;



</summary><category term="machine-learning"/><category term="ai"/><category term="openai"/><category term="dalle"/><category term="generative-ai"/></entry></feed>