[Stable Diffusion]How to write prompts (including special notation)

この記事は約10分で読めます。
スポンサーリンク

Things I want to do

When generating images using the Stable Diffusion WebUI, you might sometimes feel like, ‘It’s not quite what I imagined…’ or ‘I want to give more detailed instructions, but how?’ The process by which the AI ​​generates images is heavily influenced by the quality of the ‘prompts’ (the commands) you input.

Prompt engineering is precisely the technique of optimizing verbal instructions given to AI to elicit ideal results. This article will show you how to write prompts to efficiently generate higher-quality images.

スポンサーリンク

Basic rule

In simple terms, prompt engineering is the skill of giving optimal instructions so that generative AI (like Stable Diffusion) accurately understands your intentions. The AI ​​’creates’ images based on your words, but where that ‘creativity’ is directed depends greatly on the prompts you give.

Points for effective prompts:

  • Clarity: Avoid vague expressions and clearly communicate what you want to depict.
  • Prioritization: AI tends to prioritize keywords at the beginning of a prompt, so write the most important elements first.
  • Quality instructions: Don’t forget the keywords to improve the overall quality of the generated images.
スポンサーリンク

How to choose keywords

The prompt is not a list of words. It’s important to arrange keywords in the right structure, as it serves as a ‘blueprint’ for the AI ​​to generate the image.

Keywords for improving image quality

To improve the quality of the generated images, enter the following keywords in the prompt.beginningPlace them here. These are like a common language to tell the AI, ‘I want you to generate high-quality images.’

  • masterpiece (masterpiece)
  • best quality (Highest quality)
  • ultra detailed
  • intricate detail
  • high resolution (High resolution)
  • 8k (8K resolution)

Description of subject, characteristics, style, and background

Next, we will describe the specific details we want to depict. (Comma) , The basic format is to list them separated by commas.

  • Theme (subject): 1girl (One girl), cat (cat), mountain landscape (Mountain scenery), etc.
  • Characteristics of the subject: long blonde hair (long blonde hair), blue eyes (blue eyes), wearing a school uniform (Wearing a uniform), etc.
  • Art style: digital art (Digital art) photo-realistic (as realistic as the photo), anime style (anime style) oil painting (Oil paintings), etc.
  • Environment/Background: outdoors (outdoors) cityscape, (cityscape) cherry blossoms, (cherry blossoms), night with stars(a starry night sky), etc.

Examples of descriptions of art style/style

  • digital art (Digital Art)
  • watercolor painting (Watercolor painting)
  • oil painting (oil)
  • anime style (Anime style)
  • photo-realistic (Photo-like realism)
  • fantasy art (Fantasy Art)
  • pixel art (Pixel art)

How to use negative prompts

Negative prompts are,Tell the AI ​​which elements you don’t want it to generate.It’s an extremely powerful tool for this purpose. By configuring it properly, you can significantly reduce image glitches and unwanted elements (such as strange hands, blurring, watermarks, etc.) and improve image quality.

In the Stable Diffusion WebUI, there is a dedicated negative prompt field below the regular prompt input field.

Examples of commonly used negative prompts: low quality, worst quality, bad anatomy, bad hands, deformed, blurry, out of focus, duplicate, watermark, signature, text, ugly, disgusting, easynegative, ng_deepnegative_v1_75t

easynegativeorng_deepnegative_v1_75tThese are like a ‘set of negative prompts’ developed by the community, and they can effectively suppress multiple common negative elements.

Forge provides a NegativePrompt template.

Emphasis and decay

If you want to strongly emphasize or weaken the influence of a particular keyword, use the prompt.Weighting (emphasis/attenuation) syntaxUse this.



  • String:
    :((keyword)) or (keyword:1.X)
    • example: ((sparkling eyes)) (1.1or1.2You can also specify it using a numerical value, like this.
    • Increase the number of parentheses,1.XThe higher the value, the stronger the influence of that keyword becomes.
  • Damping:(keyword:0.X)
    • example: (too much light:0.7)
    • 1.0Specifying a value less than that will weaken the effect of that keyword.

These syntax elements are useful for fine-tuning when the AI ​​doesn’t generate elements as intended, or conversely, when it generates them too strongly.

Switching prompts ([A:B:C])

When you want to represent complex scenes, the passage of time, or changes in state, prompts are useful.Blend (switch) is.

syntax:[keywordA:keywordB:step]

  • keywordA from keywordB It gradually changes to this.
  • step This specifies the ratio to the total number of steps in the generation process, or the specific number of steps.
    • example:[day:night:0.5] → The process switches from ‘day’ to ‘night’ halfway through the generation process.

example: A person walking in a [sunny forest:dark forest:0.5] with [green leaves:autumn leaves:0.7] (A person walks through a forest that changes from one bathed in sunlight to one dark, and from one with green leaves to one with crimson leaves.)

This is a very powerful technique, but it can be difficult to intuitively predict the results, so trial and error is necessary.

スポンサーリンク

Result

This article introduced notation for generating better images using StableDiffusion.

コメント

タイトルとURLをコピーしました