This article aims to provide a comprehensive guide to the syntax and usage techniques of prompt words for the Stable Diffusion series of models, including SD 1.x to SD XL, and the latest Flux.1 model. Prompts play a critical role in AI image generation as they guide the models to understand and generate images based on user requirements. By exploring the prompt requirements and best practices for these models, you can more precisely control the content, style, details, and quality of the generated images, resulting in high-quality visuals that align with your vision.
1. Prompt Delimiters
In popular text-to-image models like Stable Diffusion and Flux.1 series, it is generally recommended to use commas (,
) as delimiters to separate prompt elements. Periods (.
) are less favored because they usually denote sentence endings and may cause confusion or fail to be recognized by the model.
It’s important to note that the weight of each prompt element diminishes sequentially from left to right. This means that keywords placed earlier have slightly higher priority. For example, placing scene-related keywords before character-related ones will emphasize the scenery, making the characters appear smaller or in the background, and vice versa.
For instance, to generate an image featuring a woman in a specific outfit with a serene outdoor background, you can use the following prompt:
mysterious woman, elegant dress, serene forest background
Here’s how the prompt is structured:
mysterious woman
: Defines the main subject—a mysterious woman. This is the most critical element.elegant dress
: Describes the woman’s outfit, which is the second most important detail.serene forest background
: Specifies the background, adding ambiance but being less critical than the subject.
This order helps the model prioritize “mysterious woman” as the core focus, followed by “elegant dress” and “serene forest background,” ensuring the image aligns with the intended hierarchy.
2. Prompt Weighting
Beyond positional weighting, explicit weights can be assigned to prompt elements using parentheses (()
). For example, to emphasize a concept, you can use the syntax (xxx: 1.x)
where xxx
is the target keyword and 1.x
represents the weight multiplier. A multiplier of 1.5
increases the weight to 150%, while 0.8
reduces it to 80%. Keep weights within the range of 0.4 to 1.6 for optimal results—values too low may be ignored, and overly high weights may cause errors.
Syntax for various weighting techniques:
(PromptA:weight)
: Adjusts the weight ofPromptA
. Values >1 increase weight, <1 decrease it.(PromptB)
: Defaults to a weight of 1.1, i.e.,(PromptA:1.1)
.{PromptC}
: Implies a weight of 1.05.[PromptD]
: Implies a weight of 0.952.((PromptE))
: Doubles the increase, equivalent to(PromptE:1.1*1.1)
.{{PromptF}}
: Equivalent to(PromptF:1.05*1.05)
.[[PromptG]]
: Equivalent to(PromptG:0.952*0.952)
.
Note on Weighting Differences:
- WebUI (and Forge): Performs weighted averaging on all prompt elements, modifying their final weights.
- ComfyUI: Retains specified weights without alteration.
3. Loading LoRA & Hypernet Models
To load LoRA or HyperNet models, use angle brackets (< >
) in the format <lora:filename:multiplier>
or <hypernet:filename:multiplier>
. Here, multiplier
controls the intensity of the model’s effect on the final image. Typically, multiplier
ranges from 0 (no effect) to 1 (full effect). For example:
<lora:FluxDFaeTasticDetails:0.5>
Ensure the relevant model files are downloaded. In ComfyUI, you can adjust the strength_model
value to set negative strengths, reducing the influence of the model.
4. Stepwise and Alternating Rendering
Square brackets ([]
) can be used to implement complex stepwise and alternating rendering requirements.
[A:B:step]
: Specifies applying effect A up to a certain progress point before transitioning to effect B. For example,[blue:red:0.4]
renders blue for the first 40% of the process, then switches to red. Note: ifstep > 1
, it indicates the number of iterations during which A is applied before switching to B; ifstep < 1
, it refers to the percentage of iteration steps.[A:0.5]
: Starts rendering A at 50% progress.[A::step]
: Removes A after a specified progress point.[A|B]
: Alternates between A and B for mixed rendering.
5. Additional Tips
- Image size impacts prompt effectiveness. Larger images require more prompts to prevent contamination or overlap.
- Prompts support emojis 😎! which can enhance expressiveness. For example, emojis can help depict emotions or specific gestures.