{"id":544,"date":"2023-10-16T15:13:24","date_gmt":"2023-10-16T07:13:24","guid":{"rendered":"https:\/\/www.1ai.net\/?p=544"},"modified":"2023-10-16T15:13:24","modified_gmt":"2023-10-16T07:13:24","slug":"stable-diffusion%e7%9a%84%e4%bd%bf%e7%94%a8%e5%85%a5%e9%97%a8%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.1ai.net\/en\/544.html","title":{"rendered":"Getting Started Tutorial on Stable Diffusion"},"content":{"rendered":"<h2 id=\"toc_1\" class=\"wp-block-heading toc-index\">1. Introduction<\/h2>\n<p><a href=\"https:\/\/www.1ai.net\/en\/tag\/stable-diffusion\" title=\"_Other Organiser\" target=\"_blank\" >Stable Diffusion<\/a>Able to generate new images through customized text descriptions or images, this AI technology enables ordinary people who are not graphic professionals to create exquisite images that roughly match their desired images.<\/p>\n<h2 id=\"toc_2\" class=\"wp-block-heading toc-index\"><span id=\"2%E3%80%81%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B\" class=\"ez-toc-section\"><\/span>2. Quick Start<\/h2>\n<h3 id=\"toc_3\" class=\"wp-block-heading toc-index\"><span id=\"21_%E4%B8%8B%E8%BD%BDstable-diffusion-webui\" class=\"ez-toc-section\"><\/span>2.1 Download stable-diffusion-webui<\/h3>\n<p>stable-diffusion-webui contains Stable Diffusion and the web interface used to operate it. This step is just to download it.<\/p>\n<pre class=\"wp-block-code language-bash\" tabindex=\"0\"><code class=\"language-bash\" lang=\"bash\">https:\/\/github.com\/AUTOMATIC1111\/stable-diffusion-webui<\/code><\/pre>\n<p>There are also installation steps below this page. Additional software required<strong><a href=\"https:\/\/www.python.org\/downloads\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python<\/a><\/strong>, please note that it is best to install<strong>Current Recommended Version<\/strong>Python.<\/p>\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-549\" title=\"1678455010-2023-03-10_212732.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678455010-2023-03-10_212732.webp.jpg\" alt=\"1678455010-2023-03-10_212732.webp\" width=\"668\" height=\"211\" \/><\/figure>\n<h3 id=\"toc_4\" class=\"wp-block-heading toc-index\"><span id=\"22_%E5%AE%89%E8%A3%85Checkpoint_Merge\" class=\"ez-toc-section\"><\/span>2.2 Install Checkpoint Merge<\/h3>\n<p>Stable Diffusion (SD for short) needs to know the data we want, such as the drawing style, content tendency, etc., so we provide it with some materials.<a href=\"https:\/\/civitai.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Civitai<\/a>A large number of resources are provided, and we can search and download them there.<\/p>\n<p>Checkpoint Merge refers to a type of basic model data, and the final generated image is consistent with the style of these model data.<a href=\"https:\/\/civitai.com\/models\/6424\/chilloutmix\" target=\"_blank\" rel=\"noreferrer noopener\">ChilloutMix<\/a>.<\/p>\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-548\" title=\"1678282682-2023-03-08_213545.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678282682-2023-03-08_213545.webp.jpg\" alt=\"1678282682-2023-03-08_213545.webp\" width=\"1200\" height=\"656\" \/><\/figure>\n<p>Download and store in<em>stable-diffusion-webui\\models\\Stable-diffusion<\/em>directory.<\/p>\n<p>Windows user execution<em>stable-diffusion-webui<\/em>Under the directory<em>webui.bat<\/em>; Linux users execute<em>webui.sh<\/em>. It will automatically download some necessary files first.<\/p>\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-545\" title=\"1678285248-2023-03-08_221846.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678285248-2023-03-08_221846.webp.jpg\" alt=\"1678285248-2023-03-08_221846.webp\" width=\"1036\" height=\"153\" \/><\/figure>\n<p>I reported several errors due to network problems. I just tried a few times. After completion, it was as shown below:<\/p>\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-547\" title=\"1678288352-2023-03-08_231042.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678288352-2023-03-08_231042.webp.jpg\" alt=\"1678288352-2023-03-08_231042.webp\" width=\"1098\" height=\"390\" \/><\/figure>\n<p>Press Elevate to open the web page:<a href=\"http:\/\/127.0.0.1:7860\/\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/127.0.0.1:7860\/<\/a><\/p>\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-546\" title=\"1678288487-2023-03-08_231405.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678288487-2023-03-08_231405.webp.jpg\" alt=\"1678288487-2023-03-08_231405.webp\" width=\"1200\" height=\"882\" \/><\/figure>\n<h3 id=\"toc_5\" class=\"wp-block-heading toc-index\"><span id=\"23_%E5%AE%89%E8%A3%85%E6%8F%92%E4%BB%B6sd_civitai_extension\" class=\"ez-toc-section\"><\/span>2.3 Install the plugin sd_civitai_extension<\/h3>\n<p>This plugin can help us get and display preview images of resources we download in Civitai.<em>Extensions<\/em>tab, then switch to<em>Install from URL<\/em>Sub-tab, enter address:<em>https:\/\/github.com\/civitai\/sd_civitai_extension<\/em><\/p>\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-550\" title=\"1678288828-2023-03-08_231950.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678288828-2023-03-08_231950.webp.jpg\" alt=\"1678288828-2023-03-08_231950.webp\" width=\"816\" height=\"393\" \/><\/figure>\n<p>Click the &quot;Install&quot; button and wait for a while. After completion, click on the left<em>Installed<\/em>Sub-tab, you can see that the sd_civitai_extension plug-in has been installed. Finally, click the &quot;Apply and restart UI&quot; button. At this point, the most basic functions of Stable Diffusion have been installed and can be used.<\/p>\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-552\" title=\"1678289053-2023-03-08_232156.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678289053-2023-03-08_232156.webp.jpg\" alt=\"1678289053-2023-03-08_232156.webp\" width=\"804\" height=\"416\" \/><\/figure>\n<p>Let&#039;s do a test first. Switch to<em>txt2img<\/em>Label, enter the desired image keywords or text description in the prompt input box above, for example:<code>The girl is flying in the sky<\/code>. In the Negative prompt input box below, you can enter keywords that you don\u2019t want to appear. Then click the \u201cGenerate\u201d button and wait for a moment to generate the image.<\/p>\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-551\" title=\"1678455517-2023-03-10_213756.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678455517-2023-03-10_213756.webp.jpg\" alt=\"1678455517-2023-03-10_213756.webp\" width=\"924\" height=\"622\" \/><\/figure>\n<p>Hahaha, at least it shows that Stable Diffusion is running normally.<\/p>\n<h2 id=\"toc_6\" class=\"wp-block-heading toc-index\"><span id=\"3%E3%80%81%E6%9B%B4%E5%A4%9A%E8%AE%BE%E7%BD%AE\" class=\"ez-toc-section\"><\/span>3. More settings<\/h2>\n<h2 id=\"toc_7\" class=\"wp-block-heading toc-index\"><span id=\"31_%E5%AE%89%E8%A3%85LoRA%E6%A8%A1%E5%9E%8B\" class=\"ez-toc-section\"><\/span>3.1 Install LoRA model<\/h2>\n<p>The LoRA model is a fine-tuning of the basic model data, which can be used to resemble the characters in LoRA. When downloading, please note that the Type on the right side of the page is<strong>LORA<\/strong>.For example<a href=\"https:\/\/civitai.com\/models\/4718\/asuna-lora\" target=\"_blank\" rel=\"noreferrer noopener\">Asuna LoRa<\/a>.<\/p>\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-554\" title=\"1678459238-2023-03-10_221136.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678459238-2023-03-10_221136.webp.jpg\" alt=\"1678459238-2023-03-10_221136.webp\" width=\"1000\" height=\"536\" \/><\/figure>\n<p>Download and store in<em>stable-diffusion-webui\\models\\lora<\/em>directory. Then click the icon under the Generate button.<\/p>\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-553\" title=\"1678459434-2023-03-10_224312.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678459434-2023-03-10_224312.webp.jpg\" alt=\"1678459434-2023-03-10_224312.webp\" width=\"376\" height=\"207\" \/><\/figure>\n<p>Switch to the Lora tab below and select the installed LoRA. Then the keyword input box above will appear.<code><\/code>. It means that the selection has been successful. The weight defaults to 1, which is usually too high and should be changed to the recommended value on the Lora download page. For example, the recommended value for Asuna LoRA is 0.6.<\/p>\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-555\" title=\"1678459963-2023-03-10_225034.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678459963-2023-03-10_225034.webp.jpg\" alt=\"1678459963-2023-03-10_225034.webp\" width=\"922\" height=\"685\" \/><\/figure>\n<p>We continue to use The girl is flying in the sky. to generate images and add the keyword asuna to trigger this LoRA. The final prompt statement is:<code>The girl is flying in the sky.asuna.<\/code><\/p>\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-556\" title=\"1678460438-2023-03-10_225818.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678460438-2023-03-10_225818.webp.jpg\" alt=\"1678460438-2023-03-10_225818.webp\" width=\"924\" height=\"620\" \/><\/figure>\n<p>The effect is... well... okay. Because our base model resource (Checkpoint Merge) is a real-life model, and this LoRA uses an anime style, the final fusion is not very good. We can download an anime style Checkpoint Merge, for example<a href=\"https:\/\/civitai.com\/models\/4437\/abyssorangemix2-sfw\" target=\"_blank\" rel=\"noreferrer noopener\">AbyssOrangeMix2<\/a>, and then generate it again.<\/p>\n<div class=\"wp-block-columns is-layout-flex wp-container-3 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-557\" title=\"1678460987-00053-1665602350.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678460987-00053-1665602350.webp.jpg\" alt=\"1678460987-00053-1665602350.webp\" width=\"512\" height=\"512\" \/><\/figure>\n<\/div>\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-558\" title=\"1678460814-00049-3884456383.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678460814-00049-3884456383.webp.jpg\" alt=\"1678460814-00049-3884456383.webp\" width=\"512\" height=\"512\" \/><\/figure>\n<\/div>\n<\/div>\n<h2 id=\"toc_8\" class=\"wp-block-heading toc-index\"><span id=\"32_%E5%AE%89%E8%A3%85%E7%95%8C%E9%9D%A2%E7%BF%BB%E8%AF%91%E6%8F%92%E4%BB%B6sd-webui-bilingual-localization\" class=\"ez-toc-section\"><\/span>3.2 Install the interface translation plugin sd-webui-bilingual-localization<\/h2>\n<p>Although most of the options in English are understandable, it is still better to have Chinese options. Switch to the Extensions tab on the page, then switch to the Available sub-tab, and click the &quot;Load from&quot; button to get the latest list of plug-ins. Find the sd-webui-bilingual-localization plug-in and click the Install button on the right to install it. Or enter the plug-in address in the Install from URL sub-tab<a href=\"https:\/\/github.com\/journey-ad\/sd-webui-bilingual-localization.git\">https:\/\/github.com\/journey-ad\/sd-webui-bilingual-localization<\/a>to install. Then switch to<kbd>Installed<\/kbd>sub-tab, click the &quot;Apply and restart UI&quot; button.<\/p>\n<p>Then download the Chinese translation file.<a href=\"https:\/\/gist.github.com\/journey-ad\/d98ed173321658be6e51f752d6e6163c\">https:\/\/gist.github.com\/journey-ad\/d98ed173321658be6e51f752d6e6163c<\/a>Download the json file and save it to<em>stable-diffusion-webui\\localizations<\/em>directory.<\/p>\n<p>On the page<kbd>Settings<\/kbd>\u00a0-&gt;\u00a0<kbd>Bilingual Localization<\/kbd>Select the translation file you just downloaded and click<kbd>Apply settings<\/kbd>and<kbd>Reload UI<\/kbd>button.<\/p>\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-559\" title=\"1678509085-2023-03-11_122943.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678509085-2023-03-11_122943.webp.jpg\" alt=\"1678509085-2023-03-11_122943.webp\" width=\"700\" height=\"730\" \/><\/figure>\n<p>Now the interface is bilingual in Chinese and English~<\/p>\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-560\" title=\"1678509152-2023-03-11_123152.webp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2023\/10\/1678509152-2023-03-11_123152.webp.jpg\" alt=\"1678509152-2023-03-11_123152.webp\" width=\"1061\" height=\"332\" \/><\/figure>\n<h2 id=\"toc_9\" class=\"wp-block-heading toc-index\"><span id=\"33_%E6%8F%90%E7%A4%BA%E8%AF%8D\" class=\"ez-toc-section\"><\/span>3.3 Prompt words<\/h2>\n<p>An image is randomly generated, but we use prompts and negative prompts to obtain and limit its &quot;brain hole&quot;. There are many sharings on the Internet, and I reproduce one here.<\/p>\n<p>Tips:<\/p>\n<blockquote class=\"wp-block-quote\"><p>1girl, solo focus, tomboy, pale skin, medium breasts, wide hips, slim, toned, delicate, gray multicolored hair, very long hair, long ponytail, yellow eyes, sweat, tall female, black shirt, white coat, black legwear, accessories, earbuds, wristwatch, piercing, cross necklace, stylish sneakers, holding cup, outdoors, cold, ((rain)), beautiful view, city view in the distance, seaside, mountainous horizon, sitting on bus stop, gloom\\(expression \\), sad, looking away, overcast, cloudy, dawn, {correct posing}, {detailed background}, {detailed body}, {correct body anatomy}, {extremely beautiful and delicate anime face and eyes}, {from the side :0.5}, {realistic:0.8},<\/p>\n<p><cite>1girl, solo focus, tomboy, pale skin, medium breasts, wide hips, slim, toned, delicate, gray colorful hair, very long hair, long ponytail, yellow eyes, sweat, tall female, black shirt, white jacket, black legwear, accessories, earbuds, watch, piercings, cross necklace, stylish sneakers, holding cup, outdoors, cold, ((rain)), beautiful view, distant city view, seaside, mountain horizon, sitting at the station, gloomy \\(expression\\), sad, looking away, overcast, cloudy, dawn, {correct pose}, {detailed background}, {detailed body}, {correct body anatomy}, {extremely beautiful and delicate anime face and eyes}, {from the side: 0.5}, {realism: 0.8},<\/cite><\/p><\/blockquote>\n<p>Reverse prompt words:<\/p>\n<blockquote class=\"wp-block-quote\"><p>nsfw, (worst quality, low quality:1.4), (lip, nose, tooth, rouge, lipstick, eyeshadow:1.4), (jpeg artifacts:1.4), (depth of field, bokeh, blurry, film grain, chromatic aberration, lens flare:1.0), (1boy, abs, muscular, rib:1.0), greyscale, monochrome, dusty sunbeams, trembling, motion lines, motion blur, emphasis lines, text, title, logo, signature, (low quality, worst quality :1.4), (bad anatomy), (inaccurate limb:1.2), bad composition, inaccurate eyes, extra digit,fewer digits,(extra arms:1.2), bad fingers, wrong expression, bad hands, incorrect anatomy hands, bad crop , cropped. terrible anatomy. text. watermark, bad nipples, lowres, no nipples, unrealistic anatomy, clipping boobs, clipping arms, bad arms, bad anatomy, bad hands, mutated hand, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name, out of focus, glowing eyes, (((multiple views))), (((bad proportions))), (((multiple legs))), (((multiple arms))), bad_prompt, wrong color, (worst quality:2.0), (low quality:2.0), inaccurate limb, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name, tall, (painting by bad-artist-anime:0.9), (painting by bad-artist:0.9), bad-prompt:0.5, watermark, text, error, blurry, jpeg artifacts, cropped, normal quality, jpeg artifacts, signature, watermark, username, artist name, (worst quality, low quality:1.4), bad anatomy, low quality lowres , low quality lowres quality lowres monochrome sketch rough graffiti, low quality lowres very ugly fat obesity scar, low quality lowres chibi, low quality lowres poorly drawn bad anatomy, low quality lowres graffiti unbecoming colorfully, low quality lowres incoherent background, low quality lowres long body, low quality lowres duplicate comparison, low quality lowres sketch retro_artstyle doujinshi, low quality lowres sketch, low quality lowres text font ui error missing digit blurry, low quality lowres JPEG artifacts signature hazy bleary, low quality lowres monochrome parody meme, low quality lowres historical picture, low quality lowres disfigured mutated malformed twisted human body, low quality lowres futanari tranny, low quality lowres tentacle skeleton, low quality lowres suicide death dirty, (nipples:1.2), lowres, bad anatomy, bad hands, text, error, missing finger, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>1\u3001Preface Stable Diffusion is able to generate brand-new images by customizing text descriptions or images. This AI technology makes it possible for ordinary people who do not specialize in graphics to create beautiful images that are roughly what they want. 2.1 Download stable-diffusion-webui stable-diffusion-webui contains Stable Diffusion and a web interface to work with it. This step starts with just downloading it. https:\/\/github.com\/AUTOMATIC1111\/stable-diffusion-webui The installation steps are also available on that page. Additional Python software is required.<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[149,144],"tags":[197,198,207],"collection":[262],"class_list":{"0":"post-544","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-jiaocheng","7":"category-baike","8":"tag-stable-diffusion","10":"tag-207","11":"collection-stablediffusion"},"acf":[],"_links":{"self":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/comments?post=544"}],"version-history":[{"count":0,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/544\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/media?parent=544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/categories?post=544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/tags?post=544"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/collection?post=544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}