{"id":12093,"date":"2024-06-03T09:35:56","date_gmt":"2024-06-03T01:35:56","guid":{"rendered":"https:\/\/www.1ai.net\/?p=12093"},"modified":"2024-06-03T09:35:56","modified_gmt":"2024-06-03T01:35:56","slug":"%e6%95%99%e4%bd%a0%e7%94%a8stable-diffusion%e5%86%99%e5%a5%bd%e6%8f%90%e7%a4%ba%e8%af%8d%ef%bc%8cstable-diffusion%e6%8f%90%e7%a4%ba%e8%af%8d%e7%9a%84%e5%9f%ba%e7%a1%80%e5%92%8c%e8%bf%9b%e9%98%b6","status":"publish","type":"post","link":"https:\/\/www.1ai.net\/en\/12093.html","title":{"rendered":"Teach you how to write prompt words with Stable Diffusion, the basic and advanced syntax of Stable diffusion prompt words"},"content":{"rendered":"<p data-track=\"1\" data-pm-slice=\"0 0 []\">Hello everyone, today I will share with you about Stable diffusion <a href=\"https:\/\/www.1ai.net\/en\/tag\/%e6%8f%90%e7%a4%ba%e8%af%8d\" title=\"[View articles tagged with [cue word]]\" target=\"_blank\" >Prompt word<\/a>Why is it necessary to understand the basic and advanced grammar of SD? First of all, prompt words have a great influence on the output effect. Understanding the usage of prompt words will help us write better prompt words. Secondly, we may copy other people&#039;s prompt words from C station. Although we can get good results by copying them directly, this will only &quot;know the result but not the reason&quot;. So if you want to master SD well, it is necessary to pass this level!<\/p>\n<h1 class=\"pgc-h-arrow-right\" spellcheck=\"false\" data-track=\"2\">1. Basic rules<\/h1>\n<p data-track=\"3\">The first rule is: prompt words are separated by English commas. If you think it is not beautiful to squeeze all the prompt words into one line, you can also wrap the line, but wrapping the line does not mean separating the prompt words. If you want to separate them, you still have to add English commas.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12094\" title=\"get-31\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/06\/get-31.jpg\" alt=\"get-31\" width=\"770\" height=\"268\" \/><\/div>\n<p data-track=\"5\">The second rule is that the weight of the prompt word decreases from the front to the back, which means that the prompt word at the front has a higher weight. However, this also has a prerequisite, that is, your prompt word does not use any syntax to increase\/decrease the weight.<\/p>\n<p data-track=\"7\">For example, I have two sets of prompt words (the general scene is a little girl and a castle):<\/p>\n<pre><code># Group A prompt words castle,landscape,1girl,loli,silver hair,school_uniform,crystal_earrings,kind_smile,arm_support,in summer,book,mini_witch_hat,frilled,strappy_heels, # Group B prompt words castle,landscape,1girl,loli,silver hair ,school_uniform,crystal_earrings,kind_smile,arm_support,in summer,mini_witch_hat,frilled,strappy_heels,book,<\/code><\/pre>\n<p data-track=\"9\">\n<p data-track=\"10\">The difference between these two sets of prompts is the position of the book prompt (one is in the middle, the other is at the end), resulting in one having more books and the other having fewer books.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12095\" title=\"get-32\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/06\/get-32.jpg\" alt=\"get-32\" width=\"1080\" height=\"534\" \/><\/div>\n<p data-track=\"12\">The third rule (note) is: the number of prompt words should be controlled within 75 tokens. According to the second rule, the later the prompt words, the lower the weight, so the more prompt words, the better.<\/p>\n<p data-track=\"14\">The SD interface actually has corresponding prompts. How are tokens calculated? Generally speaking, one word is counted as one token, including English commas. For example, &quot;castle&quot; is counted as 2 tokens.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12096\" title=\"get-33\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/06\/get-33.jpg\" alt=\"get-33\" width=\"1080\" height=\"118\" \/><\/div>\n<p data-track=\"16\">The fourth rule (note) is: use phrases instead of natural language descriptions as prompts. In the same scene as above, a loli girl stands by the castle. After translation, it will become: A loli girl stands by the castle<\/p>\n<p data-track=\"18\">This is actually a natural language description, and it can also produce a picture. However, words like by the are actually not very useful, but they waste tokens and weights.<\/p>\n<h1 class=\"pgc-h-arrow-right\" spellcheck=\"false\" data-track=\"19\">2. Prompt Word Weight Grammar<\/h1>\n<p data-track=\"20\">In SD, the default weight of each prompt word is 1. Although we can influence its weight by adjusting the position of the prompt word, this is too troublesome, so SD actually has a set of syntax for increasing\/decreasing weights.<\/p>\n<p data-track=\"22\">2.1 Bracket Enhancement<\/p>\n<p data-track=\"23\">In SD, English parentheses () can be used to enhance the weight of the prompt word. One parenthesis can increase the weight by 1.1 times. A maximum of 3 parentheses can be added, which means 1.1 * 1.1 * 1.1 = 1.331 times the weight.<\/p>\n<p data-track=\"25\">2.2 Braces enhancement?<\/p>\n<p data-track=\"26\">This needs to be verified. It is said that English curly brackets { } can also be used to enhance the weight of the prompt word, which is equivalent to 1.05 times the weight. However, I tried it and the effect was not obvious, so I am not sure whether this syntax is effective in Qiuye SD.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12098\" title=\"get-35\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/06\/get-35.jpg\" alt=\"get-35\" width=\"1080\" height=\"862\" \/><\/div>\n<p data-track=\"28\">2.3 Bracket lowering<\/p>\n<p data-track=\"29\">Similar to parentheses, but square brackets [] are used to reduce the weight of the prompt word. One square bracket is 0.9 times the weight, and a maximum of 3 square brackets is 0.729 times the weight.<\/p>\n<p data-track=\"31\">2.4 Parentheses directly enhance\/lower (recommended)<\/p>\n<p data-track=\"32\">This method is written as: (xxx: 1.5). The weight is after the colon. This setting method is recommended and looks more intuitive.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12097\" title=\"get-34\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/06\/get-34.jpg\" alt=\"get-34\" width=\"1080\" height=\"158\" \/><\/div>\n<p data-track=\"33\">Note: I tried it and it also works without the parentheses, for example book:1.5<\/p>\n<p data-track=\"35\">This method also has a shortcut key setting: first select the prompt word, then hold down the CTRL key, and use the up and down arrow keys to quickly adjust.<\/p>\n<h1 class=\"pgc-h-arrow-right\" spellcheck=\"false\" data-track=\"36\">3. Advanced Grammar of Prompt Words<\/h1>\n<p data-track=\"37\">In addition to the basic grammar mentioned above, SD&#039;s prompt words also have some advanced gameplay.<\/p>\n<p data-track=\"39\">3.1 Underline connection<\/p>\n<p data-track=\"40\">Connecting two words with an underscore (_) can serve as a connection, making it easier for SD to see them as a whole. This syntax is very common in the prompt words of the Qiuye integration pack.<\/p>\n<p data-track=\"42\">For example,<\/p>\n<pre><code># Group A prompt words: plate, coffee, cake, # Group B prompt words: plate, coffee_cake,<\/code><\/pre>\n<p data-track=\"45\">In these two groups of prompt words, in group A, since coffee and cake are not connected, SD may return both coffee and cake when drawing, but group B returns coffee and cake.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12099\" title=\"get-36\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/06\/get-36.jpg\" alt=\"get-36\" width=\"1080\" height=\"539\" \/><\/div>\n<p data-track=\"47\">3.2 Alternating Sampling<\/p>\n<p data-track=\"48\">The syntax for alternating sampling is: [prompt1 | prompt2 | prompt3]<\/p>\n<p data-track=\"50\">In this way, the first step of sampling will use prompt1, the second step will use prompt2, the third step will use prompt3, and the fourth step will use prompt1 again, and the cycle will be repeated in an alternating manner.<\/p>\n<p data-track=\"52\">If you want to combine two or more things into one, such as a color gradient, this might be a solution worth trying.<\/p>\n<p data-track=\"54\">Or give an example<\/p>\n<pre><code># Group A prompt words 1girl,red hair,blue hair,wavy hair, # Group B prompt words 1girl,[red|blue|wavy] hair,<\/code><\/pre>\n<p data-track=\"57\">The comparison chart is as follows:<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12102\" title=\"get-39\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/06\/get-39.jpg\" alt=\"get-39\" width=\"1080\" height=\"534\" \/><\/div>\n<p data-track=\"59\">3.3 Proportional Sampling<\/p>\n<p data-track=\"60\">Proportional sampling is a bit like the previous alternating sampling, but proportional sampling can be more refined!<\/p>\n<p data-track=\"62\">The first method: prompt1, [prompt2: 0-1 value]. This method means that prompt2 will be used only after the sample value reaches the specified value.<\/p>\n<p data-track=\"64\">The second method: prompt1, [prompt2:: 0-1 value]. This method has an additional colon compared to the first method, indicating that prompt2 will not be used after the sample value reaches the specified value.<\/p>\n<p data-track=\"66\">The third method: [prompt1:prompt2: 0-1 value]. Assuming the value is 0.3, this method means that prompt1 is used for the first 30% of the sampling value, and prompt2 is used for the last 70%.<\/p>\n<p data-track=\"68\">Regarding the use scenario of proportional sampling, it is actually suitable for merging multiple things together, but because it can be more refined, the output effect will be better, such as<strong>This article[1]<\/strong>It mentions merging multiple faces into a new face. If you are interested, you can take a look.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12100\" title=\"get-37\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/06\/get-37.jpg\" alt=\"get-37\" width=\"960\" height=\"392\" \/><\/div>\n<p data-track=\"69\">Note: A fusion portrait of Trump and Biden<\/p>\n<h1 class=\"pgc-h-arrow-right\" spellcheck=\"false\" data-track=\"70\">4. Preset styles of prompt words<\/h1>\n<p data-track=\"71\">Sometimes we write a set of good prompts and think we can use them again in the future. At this time, preset styles come in handy. Its function is to save the prompts so that we can reuse them directly next time.<\/p>\n<h1 class=\"pgc-h-arrow-right\" spellcheck=\"false\" data-track=\"75\">5. Prompt Word Writing Plug-in<\/h1>\n<p data-track=\"76\">If you are using Akiba&#039;s SD, then its built-in prompt word plug-in can actually meet the needs of most people. Not only does it have a lot of prompt words, but the prompt words are also well categorized and have built-in translation, which is very convenient to use.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12101\" title=\"get-38\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/06\/get-38.jpg\" alt=\"get-38\" width=\"1080\" height=\"423\" \/><\/div>\n<p data-track=\"78\">What should you do if you are using Linux or cannot use Akiba SD for other reasons? It is actually very simple, because Akiba SD also achieves the above effect by installing the prompt word plug-in. If you are using sd-webui, you can also achieve the same effect by installing the plug-in.<\/p>\n<p data-track=\"80\">Prompt word plug-in address:<strong>https:\/\/gitcode.net\/ranting8323\/sd-webui-prompt-all-in-one\/-\/blob\/main\/README_CN.MD<\/strong><\/p>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>Hello everyone, today I'm going to share with you the basic and advanced syntax of the Stable diffusion cue, why is it necessary to know this? First of all, cues have a great influence on the effect of the map, and understanding the usage of cues will help us to write better cues; secondly, we may go to the C site to copy other people's cues, although we can get good results by copying them directly, but we will only \"know what they are, but don't know why\", so if you want to master SD, this level is still necessary! SD, this level is still necessary to break! First, the basic rules of the first rule is: between the prompt word is separated by the English comma, if you feel that all the prompt word are crowded in a line is more unattractive, you can also change the line, but change the line does not mean that the separation of the prompt word, if you want to separate the words also!<\/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,837,2894],"collection":[302,262],"class_list":["post-12093","post","type-post","status-publish","format-standard","hentry","category-jiaocheng","category-baike","tag-stable-diffusion","tag-837","tag-2894","collection-prompt","collection-stablediffusion"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/12093","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=12093"}],"version-history":[{"count":0,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/12093\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/media?parent=12093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/categories?post=12093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/tags?post=12093"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/collection?post=12093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}