In this section, we'll dive into thePrompt wordof basic grammar and AI-assisted authoring techniques. You will masterStable Diffusionof the six basic grammars and learn how to let our Large Language Model (LLM) help us write prompt words.
I. The Six Basic Syntaxes of Stable Diffusion
In our previous content, we learned how to download models on the C station and try to use them. But sometimes, we see prompts that contain many symbols such as parentheses and colons - what exactly are these? How are they used? Today, we will unravel these mysteries.
1. Form of content
When constructing cues, we can use words, phrases or short sentences. In order to express more clearly the relationship between multiple subjects, it is recommended to use short sentences.
- word1girl, beautiful, sitting, table
- phrase (grammar)1 beautiful girl, sitting near the table
- clause1 beautiful girl sitting near the table
2. Separators
The separator is mainly used to differentiate between the different tags of the cue, which allows the AI to understand each separate element more clearly and avoid confusion.
When using separators, simply add a comma after each keyword or phrase.
For example, if we want to generate an image containing a girl, a beach, and a distant city, we should write the cue word like this, "girl, beach, distant city"
3. Weighted syntax
The weighting syntax allows us to emphasize or diminish certain elements. For example, using parentheses and colons to set weight values can increase or decrease the importance of specific elements. The weighting syntax is implemented by adding specific symbols to the cue words.
- Parentheses and colons: Cue words are circled in parentheses and followed by a colon and a weight value. The weight value ranges from 0.1 to 100 and defaults to 1. A value lower than 1 means that the cue is weaker, while a value higher than 1 means that it is stronger.
- Strengthening element: (city:1.5)
- Attenuating element: (city:0.5)
- Shortcut keys to adjust weights: We can quickly adjust the weight of the cue word by using a shortcut key. Hold Ctrl and press up to increase the weight, hold Ctrl and press down to decrease the weight.
- Use of different types of brackets: The weights are adjusted by adding different levels of parentheses, with each additional level of flower brackets increasing the weight by a factor of 1.05, each additional level of round brackets increasing the weight by a factor of 1.1, and each additional level of square brackets decreasing the weight by a factor of 1.1.
- Add weight: {city} or (city)
- Reduced weight: [city]
- Multiple parentheses: you can nest parentheses in multiple layers, increasing and decreasing weights
In practice, the weighting syntax can help us achieve more detailed image control. For example, if we want to emphasize the city background more in the image and reduce the percentage of people and beach, we can set it like this: (city:1.5), 1girl, beach
In this way, we can ensure that the city occupies a larger proportion of the final generated image, while other elements are relatively small.
Precautions
- The value in the weight syntax should not be too high, usually no more than 2, to avoid degradation or crashing of the image quality.
- The use of weighted syntax should be based on the actual need to rationally adjust the weight of each element to achieve the best visual effect.
4. Hybrid syntax
Stable Diffusion's blending syntax is a powerful feature that allows us to merge several different elements or concepts into a single image, creating entirely new visual entities. This syntax achieves the effect of blending multiple elements in a single image through the simple use of the "and" conjunction.
- Use of "and" conjunctions: We can combine two or more elements by adding "and" to the cue. For example, "1cat and 1dog" will produce a mixture of cat and dog.
- weightsWhen using "and", we can also set weights for each element to control their proportion in the final image. For example, "1cat:1.5 and 1dog:1" will produce a more cat-oriented blend.
5. Alternate algorithmic syntax
The alternating algorithm syntax accomplishes this by placing keywords in square brackets and separating them with vertical lines. For example, if we wanted to generate alternately between cat and dog, we could write the cue word like this, "[cat|dog]".
This syntax is particularly useful for creating gradient effects or mixing multiple elements in a scene. For example, we can use it to generate red and blue gradient hair: "[red|blue]". Additionally, the alternation algorithm can be used to create more complex images, such as a mixture of cat, dog and tiger features at the same time: "[cat|dog|tiger]".
6. Segmentation generating syntax
The basic form of segmented generative grammar is to specify two or more keywords in square brackets and to control the stage of use of these keywords in the generation process by means of colons and numbers.
- specification:: [Keywords1:Keywords2:Numbers]
- Numbers greater than 1: indicates that keyword 1 is used before step X and keyword 2 is used after step X.
- Numbers less than 1: Indicates percent X of the total number of steps before using keyword 1 and after using keyword 2.
Suppose we want to generate an image where the first half is a man and the second half becomes a flower, we can set up the cue word like this:
[man:flower:20]: use "man" as a cue word for the first 20 iterations, and "flower" thereafter.
If we want to control the switching point based on a percentage of the total iteration steps, we can set it up like this:
[man:flower:0.5]: use "man" for the first 50% and "flower" for the last 50% of the total iteration steps.
Segmented generation syntax can also be used for finer control, such as starting the drawing at a certain scale or step, or ending the drawing at a certain scale or step.
- Drawing from XX scale/step: [keyword:number], e.g. [flower:20] means use "flower" as a cue word from step 20 onwards.
- To XX scale/step cutoff drawing:[keyword::number], e.g., [flower::20] means to use "flower" as a cue word at the 20th step cutoff.
II. Using LLM to aid in creation
We can use Large Language Modeling (LLM) to help us generate cue words. Simply by providing a topic, the AI can expand and generate detailed cue words for us. This greatly reduces our workload and increases creative efficiency.
Now that you are a cue word generator based on input descriptions, you will generate cue words by visualizing the natural language I input as a complete picture. Please note that your generated content serves a drawing AI, which can only understand figurative cues and not abstract concepts. I will provide a short description in Chinese, the generator needs to provide me with the exact cue words, optimize and reorganize as necessary to provide more accurate content, and also output only the translated English content.
Please mimic the structure of the example to generate the perfect prompt words.
Example input: "A female office worker sitting on the curb"
Sample output: 1 girl, office lady, solo, (16yo), sexy, thin, beautiful detailed eyes, light blush, black hair, long hair, (mole under eye:1.2), nose blush , looking at viewer, suits, white shirt, striped miniskirt, (lace black pantyhose:1.1), black heels, LV bags, thighhighs sitting, street, shop border, (lace black pantyhose:1.1), black heels, LV bags, thighhighs sitting, street, shop border, (lace black pantyhose:1.1) akihabara , tokyo, tree, rain, cloudy, beautifully detailed background, depth of field, loli, realistic, ambient light, (cinematic composition:1.3) , neon lights, HDR, Accent Lighting, pantyshot, fish eye lens.
Please note that the (:1.x) in the example means to add weight to the prompt word, the value ranges from 0.6-1.5, the larger the value the higher the weight.
Please read my requirements carefully and follow the rules strictly to generate prompt words, if you understand, please reply "I am ready", when I enter Chinese content, please generate the English content I need.
III. Summary
In this section we learn the six basic syntax of Stable Diffusion and AI-assisted creation techniques.
By mastering these techniques, you will be better able to create stunning artwork.