{"id":3559,"date":"2024-02-02T09:44:45","date_gmt":"2024-02-02T01:44:45","guid":{"rendered":"https:\/\/www.1ai.net\/?p=3559"},"modified":"2024-02-02T09:44:45","modified_gmt":"2024-02-02T01:44:45","slug":"stable-diffusion%e5%ad%a6%e4%b9%a0%e6%8c%87%e5%8d%97%ef%bc%8cstable-diffusion%e8%af%a6%e7%bb%86%e5%ae%89%e8%a3%85%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.1ai.net\/en\/3559.html","title":{"rendered":"Stable Diffusion learning guide, Stable Diffusion detailed installation tutorial"},"content":{"rendered":"<section draggable=\"false\" data-tools-id=\"68117\">\n<section>\n<section>\n<section>\n<section>I told my friends before that I would start sharing later. <a href=\"https:\/\/www.1ai.net\/en\/zhuanti\/stablediffusion\/\">Stable Diffusion<\/a> , but I have shared it before.\u00a0<a href=\"https:\/\/www.1ai.net\/en\/tag\/stable-diffusion\" title=\"_Other Organiser\" target=\"_blank\" >Stable Diffusion<\/a> Some cool operations, such as artistic QR codes and artistic light and shadow fonts.<\/p>\n<p>But since it is a study note, of course it must have a beginning and an end. I must start sharing it systematically to be worthy of my friends who follow me.<\/p>\n<p>So, today we will start with the installation of SD. &quot;From now on, SD will stand for Stable Diffusion. It&#039;s better to have fewer words, after all, your hands will be tired.&quot;<\/p>\n<p>For a specific introduction, you can actually refer to <a href=\"https:\/\/www.1ai.net\/en\/tag\/midjourney\" title=\"_Other Organiser\" target=\"_blank\" >Midjourney<\/a>&quot;Hereafter referred to as MJ&quot;, but MJ is paid online, and SD can be installed on your own computer for free &quot;but the computer configuration requirements are a bit high&quot;; well, MJ is relatively simple to operate, and the operating threshold of SD is higher.<\/p>\n<p>Well, how should I put it? Taking the martial arts secrets as an example, the mental level of SD is higher than that of MJ. The more energy you put in, the greater the reward. Compared with MJ, SD is more varied, and you never know where the potential of SD lies.<\/p>\n<p>Enough of words, let&#039;s get straight to the point. You can experience it for yourself later!<\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p data-tools-id=\"79632\">\u2014<\/p>\n<p data-tools-id=\"79632\">If you want to experience SD, there are three main ways:<\/p>\n<p data-tools-id=\"79632\">Solution 1: Deploy on your own computer (basic computer configuration required).<\/p>\n<p data-tools-id=\"79632\">Solution 2: Deployment on a cloud server &quot;costs a little money, but is not expensive.&quot;<\/p>\n<p data-tools-id=\"79632\">Option three: Get SD for free from online websites.<\/p>\n<p data-tools-id=\"79632\">The above three solutions each have their own advantages and disadvantages. After I finish introducing them, you can choose the one that suits you best.<\/p>\n<p data-tools-id=\"79632\">\u2014<\/p>\n<p data-tools-id=\"79632\"><strong>Solution 1: Local deployment (Windows version installed on your own computer)<\/strong><\/p>\n<p data-tools-id=\"79632\">Note: I don\u2019t have a Mac, so I have no right to speak since I haven\u2019t operated it, so I will mainly introduce the local deployment under the Windows version.<\/p>\n<p data-tools-id=\"79632\">Configuration requirements:<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<p data-tools-id=\"79632\">The memory should be more than 16G, 8G is not recommended. 8G will cause lag when opening a few applications.<\/p>\n<\/li>\n<li>\n<p data-tools-id=\"79632\">Graphics cards generally require N cards &quot;Nvidia&quot;, A cards &quot;AMD&quot; are not recommended. Video memory should be 4G or more, the larger the better, especially when it comes to running large pictures and refining elixirs (which will be introduced later).<\/p>\n<\/li>\n<li>\n<p data-tools-id=\"79632\">The CPU doesn&#039;t have many requirements.<\/p>\n<\/li>\n<li>\n<p data-tools-id=\"79632\">It is recommended that the solid-state drive be 200G or larger, after all, a model takes up several GB.<\/p>\n<\/li>\n<\/ul>\n<p data-tools-id=\"79632\">The following is a performance comparison of graphics cards when running SD. You can feel it intuitively and then choose the graphics card that suits you. I use the RTX3060 12G version of the graphics card, which is an entry-level configuration. &quot;Basically, you can experience all the functions of SD, but it&#039;s a bit slow.&quot;<\/p>\n<p data-tools-id=\"79632\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3560\" title=\"640-24\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-24.png\" alt=\"640-24\" width=\"1080\" height=\"608\" \/><\/p>\n<p data-tools-id=\"79632\">First of all, I would like to thank Qiuye from Bilibili for developing the SD one-click integration package, which saves us from trial and error step by step and scratching our heads. Yes, it is the legendary lazy integration package, familiar with it!<\/p>\n<p data-tools-id=\"79632\">The following is the Baidu network disk link of the integration package:<\/p>\n<p><span class=\"wx_text_underline\">https:\/\/pan.baidu.com\/s\/1ll4xB8MiaWD46k5Q0REO0A?pwd=byip<\/span><\/p>\n<p>There are three files after downloading. First, click &quot;Starter Runtime Dependencies&quot; and click the installation steps to complete. I will not talk about the first file for now, as it is not used for the time being.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3561\" title=\"640-25\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-25.png\" alt=\"640-25\" width=\"661\" height=\"126\" \/><\/p>\n<p>Then the second step is to unzip the &quot;sd-webui-aki-v4.1.zip&quot; file. Now it has been updated to version 4.2, and the operation is the same. The version in Baidu Netdisk is 4.2.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3562\" title=\"640-26\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-26.png\" alt=\"640-26\" width=\"675\" height=\"115\" \/><\/p>\n<p>After decompression, it will look like this. Just click &quot;A Launcher.exe&quot;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3563\" title=\"640-27\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-27.png\" alt=\"640-27\" width=\"638\" height=\"486\" \/><\/p>\n<p>It is normal for this page to appear, just wait for the update to complete.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3564\" title=\"640-28\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-28.png\" alt=\"640-28\" width=\"485\" height=\"270\" \/><\/p>\n<p>This is the startup page, just click &quot;One-click Start&quot;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3565\" title=\"640-29\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-29.png\" alt=\"640-29\" width=\"1080\" height=\"633\" \/><\/p>\n<p>After waiting for the startup to succeed, if this page pops up on your default browser, it means the startup is successful and you can have fun!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3566\" title=\"640-30\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-30.png\" alt=\"640-30\" width=\"1080\" height=\"610\" \/><\/p>\n<p>\u2014<\/p>\n<p><strong>Solution 2: Cloud deployment<\/strong><\/p>\n<p>What if your computer configuration is not good enough but you still want to play SD? There is a way. After all, all roads lead to Rome. Next, I will talk about how to deploy it in the cloud. It is actually very simple.<\/p>\n<p>First of all, you need to choose a GPU cloud rental platform, because SD can only be deployed on the GPU cloud platform. I am using the AutoDL computing power cloud platform here, so I will use AutoDL to demonstrate it.<\/p>\n<p>AutoDL website: https:\/\/www.autodl.com\/home<\/p>\n<p>After registering and logging in, the first thing to do is of course to recharge money. Move the mouse to the upper right corner of the homepage, the following interface will pop up, just click recharge, and recharging 5 or 10 yuan is enough.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3567\" title=\"640-31\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-31.png\" alt=\"640-31\" width=\"775\" height=\"623\" \/><\/p>\n<p>Then everyone chooses the computing power market. The default billing method is &quot;pay as you go&quot;. We just use the default. The following are the prices per hour for different GPU models. Everyone can rent according to their needs. Anyway, I usually use RTX 3080, which costs less than 1 yuan per hour.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3568\" title=\"640-32\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-32.png\" alt=\"640-32\" width=\"1080\" height=\"603\" \/><\/p>\n<p>After entering this page, select Community Mirror, enter LazyDog, and select the latest version. Yes, there is also a lazy one-click package here, which is also a mirror that has been built for you by various masters, you can just use it directly. Leave the other parameters as default, and then click Create Now in the lower right corner.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3569\" title=\"640-33\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-33.png\" alt=\"640-33\" width=\"1080\" height=\"842\" \/><\/p>\n<p>Wait for the instance to be created and started.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3570\" title=\"640-34\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-34.png\" alt=\"640-34\" width=\"1080\" height=\"163\" \/><\/p>\n<p>After booting up, click &quot;JupyterLab&quot;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3571\" title=\"640-35\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-35.png\" alt=\"640-35\" width=\"1080\" height=\"258\" \/><\/p>\n<p>The following is the homepage. The master has written the instructions for starting SD for you. I will not repeat them. Just follow the instructions and start it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3572\" title=\"640-36\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-36.png\" alt=\"640-36\" width=\"1080\" height=\"487\" \/><\/p>\n<p>The specific operations should be performed in the terminal.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3573\" title=\"640-37\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-37.png\" alt=\"640-37\" width=\"1080\" height=\"356\" \/><\/p>\n<p>Since the system image is generated in the system disk by default, but the capacity of the system disk is relatively small, you can migrate the entire SD folder in the system disk to the data disk. The data will not be lost when the service is restarted.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3574\" title=\"640-38\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-38.png\" alt=\"640-38\" width=\"666\" height=\"195\" \/><\/p>\n<p>If the URL: http:\/\/127.0.0.1:6006 appears, it means that the startup is successful. Please remember to set up academic acceleration before starting the script. &quot;Open and see me.txt first&quot; is also in the instructions. I just want to emphasize it again.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3575\" title=\"640-39\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-39.png\" alt=\"640-39\" width=\"1074\" height=\"849\" \/><\/p>\n<p>Then go back to our instance interface and click &quot;Customize Service&quot;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3576\" title=\"640-40\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-40.png\" alt=\"640-40\" width=\"1080\" height=\"340\" \/><\/p>\n<p>The following dialog box will pop up. Simply click &quot;SSH Tunnel&quot; and follow the official documentation.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3577\" title=\"640-41\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-41.png\" alt=\"640-41\" width=\"602\" height=\"237\" \/><\/p>\n<p>How to upload the models and plug-ins needed for SD? Select &quot;File Storage&quot; in the instance&#039;s running interface, then select the zone where your current instance is located, and click &quot;Initialize File Storage&quot;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3578\" title=\"640-42\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-42.png\" alt=\"640-42\" width=\"1080\" height=\"605\" \/><\/p>\n<p>After the initialization is successful, the interface will look like this. Click &quot;Upload&quot; to upload your models and plugins. Please note that the free storage space is only 20G. If it exceeds this, you will be charged!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3580\" title=\"640-44\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-44.png\" alt=\"640-44\" width=\"1080\" height=\"551\" \/><\/p>\n<p>The uploaded files will appear in the \/root\/autodl-fs directory of your terminal. You can directly migrate them to the specified directory of your SD.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3579\" title=\"640-43\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-43.png\" alt=\"640-43\" width=\"1010\" height=\"166\" \/><\/p>\n<p>Or you can also bind your network disk to upload the model. For specific operations, please refer to the official documentation:<\/p>\n<p>https:\/\/www.autodl.com\/docs\/nas\/. If you encounter any problems, you can also read the official help documentation of AutoDL first.<\/p>\n<p>Finally, I would like to remind you that you must remember to turn off the phone after use! Otherwise, the charge will continue to be deducted. So friends, try not to charge too much money. If you forget to charge 5 or 10 yuan, you don\u2019t have to worry about it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3581\" title=\"640-45\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-45.png\" alt=\"640-45\" width=\"1080\" height=\"167\" \/><\/p>\n<p>\u2014<\/p>\n<p><strong>Option 3: Free online websites<\/strong><\/p>\n<p>Recommend an online free website, which is also a SD model download website:<span class=\"wx_text_underline\">https:\/\/www.liblibai.com\/<\/span><\/p>\n<p>After logging in and registering, click &quot;Online Stable Diffusion&quot; in the upper right corner to have fun.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3583\" title=\"640-47\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-47.png\" alt=\"640-47\" width=\"1080\" height=\"382\" \/><\/p>\n<p>The official website has a tutorial for beginners. If you need it, you can read the tutorial before you start. Then, since it is free, a single account can only generate 100 pictures per day.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3582\" title=\"640-46\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/02\/640-46.png\" alt=\"640-46\" width=\"749\" height=\"344\" \/><\/p>\n<p>The above is all the content for today. I will not introduce the interface parameters of SD today, otherwise it will be too long and I am afraid that my friends will not be able to read it. Friends who are anxious can also learn about it by themselves first!<\/p>\n<p>Today we mainly introduce three SD experience solutions, and you all have your own choices. But to be honest, if you really want to study SD in depth, Tingyu still recommends that you deploy it locally, after all, you can do whatever you want!<\/p>","protected":false},"excerpt":{"rendered":"<p>As I told you before, I will start to share Stable Diffusion's operation guide, but I have shared some of Stable Diffusion's operation before, such as artistic QR code and artistic light and shadow fonts. However, since this is a study note, of course, we have to start from the beginning and finish from the end, and we have to start sharing systematically in order to be worthy of all my friends who have been paying attention to me. Therefore, today we will start from the installation of SD to talk about \"subsequent to SD to represent Stable Diffusion ha, less words is also good, after all, hand tired ah\". For details, you can refer to Midjourney \"MJ for short\", except that MJ is paid online, while SD can be installed for free at<\/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":[186,197,1138],"collection":[262],"class_list":["post-3559","post","type-post","status-publish","format-standard","hentry","category-jiaocheng","category-baike","tag-midjourney","tag-stable-diffusion","tag-1138","collection-stablediffusion"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/3559","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=3559"}],"version-history":[{"count":0,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/3559\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/media?parent=3559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/categories?post=3559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/tags?post=3559"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/collection?post=3559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}