Stable Diffusion Tip Word Technique


With the continuous development of AI technology, more and more new algorithms are emerging, such as Stable Diffusion, Midjourney, Dall-E, etc. Compared with traditional algorithms such as GAN and VAE, these new algorithms perform better in generating high-resolution and high-quality images, taking AI image generation to a new level. AI image generation brings benefits to all walks of life. had a very important impact. For example, Stable Diffusion technology only needs to use designed text to generate the required pictures, and these texts are called prompt words , so the design of the prompt words also determines the quality of the generated pictures.

Background introduction

Stable Diffusion is a Vincentian graph AI model based on Latent Diffusion Model (LDM). The core idea is to gradually approach the real image by continuously adjusting the implicit representation of the image. The specific implementation is to convert the initial noise vector into an implicit representation of the image through a latent space network. Then, for each time step, a diffusion process is used to gradually optimize this representation so that it approximates the implicit representation of the real image. Finally, this implicit representation is converted into the generated image through an inverse transformation.

Compared with traditional generation models, Stable Diffusion generates images with higher quality, faster speed and lower cost. Specifically, Stable Diffusion can achieve image generation on consumer-grade graphics cards, and the generation speed is 30 times higher than traditional generation models. This makes Stable Diffusion one of the most advanced generative models currently and has received widespread attention.
Demo experience: https://stablediffusionweb.com/#demo

How to write prompt words

Under normal circumstances, the prompt words of the Stable Diffusion model include positive prompt words and negative prompt words. The so-called prompt words are actually prompts, and there are also some popular names such as keywords, spells, instructions, etc.
In the Stable Diffusion WebUI, you can see the following two boxes, which are used to fill in positive prompt words and negative prompt words.
Insert image description here
The so-called positive prompt words are to tell the AI ​​what to generate. Negative prompts tell the AI ​​what not to generate. One thing to note here is that there are infinitely many pictures in the world, so the style and effect of the generated pictures are not only related to the prompt words, but also have a great relationship with the Vincentian graph model. Therefore, before using the prompt words, you must according to your own You need to choose a suitable model.

Prompt word grammar

When using prompt words for image and text generation, you will find that some simple prompt words are composed of phrases or words, while some more complex prompt words also contain some brackets, numbers, etc., so if you want to learn more about using prompt words, you can Need to master some grammar of prompt words.

1. The first thing to note is that all the symbols used in the grammar are English characters , and the default prompt words are written using commas to separate them.

2. The earlier the prompt word, the higher the weight, that is, the generated picture is more in line with the requirements of the previous prompt word. Key prompt words should be placed as far forward as possible, but be careful not to write too many keywords, no more than 75 at most. .

3. English brackets represent increase or decrease in weight. ( ) means the weight increases by 1.1 times every time, and [ ] means the weight decreases by 1.1 times every time. Of course, the effect of reducing the weight can be achieved in the brackets, that is, by colon + weight value. . (It should be noted that parentheses can be superimposed, but it is generally not recommended).
like:

(word): Increase the weight of the prompt words in brackets by 1.1 times
((word)): Increase the weight of the prompt words in brackets by 1.21 times (= 1.1 * 1.1)
[word]: Reduce the weight of the prompt words in brackets by 1.1 times
(word:1.5): Increase the weight of the prompt words in brackets by 1.5 times
(word:0.25): Reduce the weight of the prompt words in brackets by 4 times (= 1 / 0.25)

Tips: First select the prompt word to be weighted, Ctrl + ⬆ to increase the weight, Ctrl + ⬇ to decrease the weight.

4. Control the number of steps to generate different content. The syntax is: [from:to:when].
Among them, from represents the number of steps of sampled image information before, to represents the number of steps of sampled information after, and when represents the number of steps sampled by the former. If the value of when is an integer greater than 0, it refers to the number of steps. If it is a decimal greater than 0 and less than 1, it represents the percentage of the former sampling steps to the total number of steps. (The total number of steps is usually an optional value)
For example: when the sampling steps (Sampling steps) is 20,
[men:women:0.5]: indicates that the first 50% steps (10 steps) draw men, and the last 50% steps (10 steps) Step) Draw women.
Insert image description here

Variations on this usage:

[to:when]//Start drawing after the set number of steps
[from::when]//End drawing after the set number of steps
Example:

[tree:background:0.5] represents the first 50% steps to draw the tree and the last 50% steps to draw the background.
[tree:0.5] represents the last 50% step to start drawing the tree.
[tree::0.5] represents the first 50% steps to draw the tree, and then ends the tree drawing when 50% of the steps are reached.

5. Two or more prompt words have the same weight. Use capital AND
as mentioned in point 2. The earlier the prompt word, the higher the weight. AND can make the weight of two or more prompt words consistent.

a lion AND a bear

Insert image description here

This syntax supports specifying a weight value: the default weight value is 1, you can also specify the weight of each prompt word, for example:

a lion :1.3 AND a cat :1.2 AND a bear :1.5

Insert image description here

6. Alternate drawing:
The syntax means changing a prompt word every other step to draw alternately. This syntax can draw various fusion monsters.

For example, to draw dogs and cats alternately, you can use

[cat|dog]

Insert image description here

positive cue word

If you want to write a good positive prompt word, you generally need to consider the following aspects:
(1) subject
(2) medium
(3) quality
(4) style
(5) color
(6) lighting
(7) ) Painter Artist

1. Consider the subject

angle:

low angle, wide-angle, panorama, full-body
, close-up, drone

Place:

in an empty square, in a fallout city, in a dense
forest

background:

Busy metropolis, Sunset glowBusy
metropolis, Sunset glow

Consider facial expressions, emotions

laughing, contempt
, angry

Consider the atmosphere


mysterious , misty, spooky

Pay attention to the flexible use of scripts (Script)

X/Y plot: Compare prompt words and produce multiple graphs. You can compare multiple pictures horizontally. You need to select Prompt S/R for X/Y plot.
Insert image description here

Matrix: Add | in front of one or more words in the prompt and set the prompt Matrix to generate two or more pictures containing the keyword.
Insert image description here

2. Consider the medium,
what kind of painting: such as oil painting, illustration, electronic painting, photo. You
can also use the X-axis to find different styles.

illustration, digital painting, oil painting, photography, charcoal drawing
, sketch

3. Image quality

4k, 8k, 64k, uhd, high quality

4. Style

Impressionist, surrealist, pop art, hyperrealistic, Modernist
, art nouveau

5、color

vivid color
, black and white

6、Lighting

Cinematic lighting, soft lighting, rim light, dimly lit
Cinematic lighting, soft lighting, rim light, dimly lit

7、画家
Alphonse Mucha, greg rutkowski, rhads, trending on artstation, trending on deviant art

negative cue words

In the example above, only positive prompt words are written, but the fields for negative prompt words below are all blank. The model will try its best to draw the content you want to see based on the positive prompt words, but if the negative prompt words are not added, the model will still generate some content you do not want to see. Negative cue words and positive cue words are equally important, and using negative cue words is also an important part of the generation iteration process.

Therefore, when generating pictures, it is often necessary to add some negative prompt words to avoid bad results. Moreover, AI drawing sometimes does not produce good results in one go, so it is necessary to add negative prompt words for control, which is especially important when doing large-scale drawings.

Add some common "bad" features, such as:

Ugly, poorly drawn hands, poorly drawn feet, poorly drawn face, superfluous limbs, disfigurement,

ugly, poorly drawn hands, poorly drawn feet, poorly drawn face, extra limbs, disfigured,

Include information that affects quality characteristics, such as:

Distortion, low quality, poor structure, watermark, signature, cropping, low contrast, underexposure, overexposure, poor art, blur

deformed, lowers, bad anatomy, , cut off, low contrast, underexposed, overexposed, bad art, blurry,

Add things you don't want to see, for example:

not safe for word, weapon, blood, signature, watermark,

nsfw, weapon, blood, watermark, signature

Tips website worth referencing
If you are using an SD model and want to generate a real person, please see the famous artists in history compiled by Voldy .

If you are using an anime-style model, please look at the tags in the Danbooru gallery to decide which prompt words to place.

Prompt Generator and NovelAI Magic Book can help you combine prompt words.

In addition to downloading models, Civitai also has many ready-made examples of prompt word matching models that you can copy.

Guess you like

Origin blog.csdn.net/dzysunshine/article/details/132433890