{"id":327,"date":"2022-09-26T20:47:36","date_gmt":"2022-09-27T00:47:36","guid":{"rendered":"https:\/\/kryptech.name\/site\/?p=327"},"modified":"2022-09-26T20:54:57","modified_gmt":"2022-09-27T00:54:57","slug":"ai-image-generation-with-stable-diffusion","status":"publish","type":"post","link":"https:\/\/kryptech.name\/site\/index.php\/ai-image-generation-with-stable-diffusion\/","title":{"rendered":"AI Image Generation with Stable Diffusion"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>Lately I&#8217;ve been enthralled with AI image generation, specifically Stable Diffusion. The idea is that you have a model that relates text to images. The tool generates noise and refines it over steps into an image that relates to the prompt. I&#8217;d previously signed up for the beta access to <a href=\"https:\/\/openai.com\/dall-e-2\/\">DALL\u00b7E 2<\/a> and got to try it out. You get a certain amount of free credits per month, which is nice, but AI image generation is a lot about trial-and-error and thus it&#8217;s easy to chew through credits while trying to tweak the prompt to get the target image result. I also played around with <a href=\"https:\/\/beta.dreamstudio.ai\/\">Stability.Ai&#8217;s DreamStudio<\/a> Lite, which has a similar credit model.<\/p>\n\n\n\n<p>On August 22, 2022 <a href=\"https:\/\/stability.ai\/blog\/stable-diffusion-public-release\">Stability.Ai publicly released their text-to-image model<\/a> &#8211; a big move that opened up lots of options for developers. After trying a few different projects I landed on <a href=\"https:\/\/github.com\/AUTOMATIC1111\/stable-diffusion-webui\">AUTOMATIC111 \/ stable-diffusion-webui<\/a>, which was pretty easy to set up and has optimizations that make it very usable on my NVIDIA video card with 4GB of VRAM. At 512 x 512 pixels, it usually takes between 1-3 seconds per iteration but I&#8217;m a patient person and the tools allows for great batching so that you can set up a bunch variations and then check back when done.<\/p>\n\n\n\n<p>Below are some of the images I&#8217;ve generated. These are typically the result of a number of &#8220;img2img&#8221; iterations &#8211; taking the result from the initial text prompt, noising it up a certain percentage and using that plus a a text prompt to nudge the result toward what I had in mind. Sure, it&#8217;s fun to just type in something and get results but that&#8217;s not satisfying for me.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00099-Euler-100.jpg\"><img loading=\"lazy\" width=\"1024\" height=\"512\" src=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00099-Euler-100-1024x512.jpg\" alt=\"\" class=\"wp-image-330\" srcset=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00099-Euler-100-1024x512.jpg 1024w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00099-Euler-100-300x150.jpg 300w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00099-Euler-100-768x384.jpg 768w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00099-Euler-100-1536x768.jpg 1536w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00099-Euler-100.jpg 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>Stable Diffusion does detailed textures very well<\/figcaption><\/figure>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00106-Euler-50.jpg\"><img loading=\"lazy\" width=\"512\" height=\"512\" src=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00106-Euler-50.jpg\" alt=\"\" class=\"wp-image-331\" srcset=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00106-Euler-50.jpg 512w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00106-Euler-50-300x300.jpg 300w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00106-Euler-50-150x150.jpg 150w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/figure><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00127-DPM2-a-100.jpg\"><img loading=\"lazy\" width=\"1024\" height=\"1024\" src=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00127-DPM2-a-100.jpg\" alt=\"\" class=\"wp-image-332\" srcset=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00127-DPM2-a-100.jpg 1024w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00127-DPM2-a-100-300x300.jpg 300w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00127-DPM2-a-100-150x150.jpg 150w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00127-DPM2-a-100-768x768.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>It&#8217;s fun watching how mechanical things are generated, how parts meld together<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00149-Euler-40.jpg\"><img loading=\"lazy\" width=\"1024\" height=\"1024\" src=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00149-Euler-40.jpg\" alt=\"\" class=\"wp-image-333\" srcset=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00149-Euler-40.jpg 1024w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00149-Euler-40-300x300.jpg 300w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00149-Euler-40-150x150.jpg 150w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00149-Euler-40-768x768.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00154-Euler-100.jpg\"><img loading=\"lazy\" width=\"1024\" height=\"1024\" src=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00154-Euler-100.jpg\" alt=\"\" class=\"wp-image-334\" srcset=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00154-Euler-100.jpg 1024w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00154-Euler-100-300x300.jpg 300w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00154-Euler-100-150x150.jpg 150w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00154-Euler-100-768x768.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>In some variations, the rock on the right was textured like a tree instead<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00209-Euler-100.jpg\"><img loading=\"lazy\" width=\"1024\" height=\"1024\" src=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00209-Euler-100.jpg\" alt=\"\" class=\"wp-image-335\" srcset=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00209-Euler-100.jpg 1024w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00209-Euler-100-300x300.jpg 300w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00209-Euler-100-150x150.jpg 150w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00209-Euler-100-768x768.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00251-Euler-100.jpg\"><img loading=\"lazy\" width=\"1024\" height=\"1024\" src=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00251-Euler-100.jpg\" alt=\"\" class=\"wp-image-336\" srcset=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00251-Euler-100.jpg 1024w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00251-Euler-100-300x300.jpg 300w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00251-Euler-100-150x150.jpg 150w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00251-Euler-100-768x768.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00273-Euler-40.jpg\"><img loading=\"lazy\" width=\"1024\" height=\"1024\" src=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00273-Euler-40.jpg\" alt=\"\" class=\"wp-image-337\" srcset=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00273-Euler-40.jpg 1024w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00273-Euler-40-300x300.jpg 300w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00273-Euler-40-150x150.jpg 150w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00273-Euler-40-768x768.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>I edited an initial version to add blobs for face and hands and then ran it through further img2img to build the detail<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00369-DPM2-100.jpg\"><img loading=\"lazy\" width=\"1024\" height=\"1024\" src=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00369-DPM2-100.jpg\" alt=\"\" class=\"wp-image-338\" srcset=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00369-DPM2-100.jpg 1024w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00369-DPM2-100-300x300.jpg 300w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00369-DPM2-100-150x150.jpg 150w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00369-DPM2-100-768x768.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>Stable Diffusion struggles with positional prompts, like &#8220;parrot on shoulder&#8221;, so I edited in the parrot on a good version of the man and then Stable Diffusion was able to stitch the two together<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00419-Euler-100.jpg\"><img loading=\"lazy\" width=\"1024\" height=\"1024\" src=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00419-Euler-100.jpg\" alt=\"\" class=\"wp-image-339\" srcset=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00419-Euler-100.jpg 1024w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00419-Euler-100-300x300.jpg 300w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00419-Euler-100-150x150.jpg 150w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00419-Euler-100-768x768.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>A edited in the fire on the right and the vertical lines of the structure at the top left and then ran it through again to bring out the detail<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00420-Euler-100.jpg\"><img loading=\"lazy\" width=\"1024\" height=\"1024\" src=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00420-Euler-100.jpg\" alt=\"\" class=\"wp-image-340\" srcset=\"https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00420-Euler-100.jpg 1024w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00420-Euler-100-300x300.jpg 300w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00420-Euler-100-150x150.jpg 150w, https:\/\/kryptech.name\/site\/wp-content\/uploads\/2022\/09\/00420-Euler-100-768x768.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img alt=\"\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lately I&#8217;ve been enthralled with AI image generation, specifically Stable Diffusion. The idea is that you have a model that relates text to images. The tool generates noise and refines it over steps into an image that relates to the prompt. I&#8217;d previously signed up for the beta access to DALL\u00b7E 2 and got to &#8230;<a class=\"post-readmore\" href=\"https:\/\/kryptech.name\/site\/index.php\/ai-image-generation-with-stable-diffusion\/\">read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":330,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[27,24,28,26],"_links":{"self":[{"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/posts\/327"}],"collection":[{"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/comments?post=327"}],"version-history":[{"count":4,"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/posts\/327\/revisions"}],"predecessor-version":[{"id":342,"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/posts\/327\/revisions\/342"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/media\/330"}],"wp:attachment":[{"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/media?parent=327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/categories?post=327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/tags?post=327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}