Jim Clyde Monge | 07 Jun, 2023

How to Write the Best Stable Diffusion Prompts in 2024

Do you want to generate high-quality images with the popular AI image tool, Stable Diffusion? Great, then you need to learn how to write the best Stable Diffusion prompts!

If you’ve spent any time using the best AI tools in 2024, you’ve likely noticed the quality of the output depends on the quality of your AI prompt. 

But how do you create good Stable Diffusion prompts? This all comes down to AI prompt engineering

But what is prompt engineering? And why is it important for AI image tools?

I like to think about it like this. If an AI image tool is my private artist, it can only create an impressive image if I can provide a high-quality Stable Diffusion prompt. This is the skill of AI prompt engineering for Stable Diffusion.

Plus, I don’t need a powerful desktop to create eyecatching images. AI prompt engineering even works on low-cost tablets. That means I can relax on the couch while crafting intricate prompts, and all I need is my understanding of which elements to include.

That’s why we’ve created this guide to creating Stable Diffusion prompts to teach you everything you need to know to create amazing images with this open-source AI tool.

So whether you’re a professional artist that wants to leverage AI image tools or a creative person that’s fascinated by AI image generation, this article will show you how to create good Stable Diffusion prompts. 

Let’s get started!

What Is Stable Diffusion? 

Stable Diffusion is a text-to-image diffusion model from Stability AI that is capable of generating photo-realistic images given any text input. It works similarly to other popular AI image generator tools like OpenAI’s Dall-E2 and MidJourney

But what sets Stable Diffusion apart from the competition? 

It is open-source. 

That means developers can modify the model, contribute to the development, and create their own applications based on the AI model. 

If some of these terms are a little alien to you or if you’re new to the world of AI image tools, we’d highly recommend checking out the best Stable Diffusion courses on Udemy. These are a great way to build your skills and help you get the most out of this guide.

Now, let’s look at some Stable Diffusion examples, including how to create the best Stable Diffusion prompts.

The Anatomy of a Good Stable Diffusion Prompt

If you want to build a good prompt for Stable Diffusion, you need to start with the three main components:

  • Subject
  • Details
  • Art style

Let’s take a look at each of these components in more detail.

Subject: Start with the subject, which is essentially what you want to see in the image. Say you want to create an image of a female model. Your prompt begins with “An image of a female model”.

Details: Next, add details to the subject. Tools like Promptomania offer a wide variety of image details that you can specify, ranging from medium to color, lighting, and so on.

Style: Finally, incorporate the art style of a certain artist that you want to replicate.

Consider this example of an image generated with a prompt that includes the subject, details, and the art style of a different artist.

Impressive, isn’t it?

How to Create Stable Diffusion Prompts: Pro Tips 

Now we’ve learned to create good AI prompts for Stable Diffusion, let’s take a look at some pro tips that you can use to produce the very best AI images.

Use Text Weights

Text weights are numerical values used in AI image generators to control the emphasis placed on specific elements within an image.

For instance, assigning a higher text weight to “dog” enables the adjustment of the focal point in the image, enhancing its resemblance to a dragon rather than a dog. 

If you want to adjust the weight of a keyword, you just need to use the general syntax:

keyword: factor

As expected, the keyword corresponds to an element you’ve asked to include in the image. The weight adjustment is made with the value that you assign to factor

This is simply a value that, when set to less than 1, means the keyword is less important. And as you’ve probably guessed, a value larger than 1 means the keyword is more important. 

Let’s take a look at some example prompts that will alter the emphasis of a dog in an image.

To reduce the emphasis on the dog: (dog:0.5)

To increase the emphasis on the dog: (dog:1.5)

You can see the effect of using these text weights in the image below.

Use Negative Prompts

Using negative prompts is an effective technique to direct the output of an image generator. Instead of specifying desired elements, negative prompts involve expressing what one does not want to see. 

These prompts are not limited to objects alone; they can also encompass styles and undesirable characteristics. For instance, terms like “ugly” or “deformed” can be utilized as negative prompts to fix the deformity and aesthetic of the generated image.

Take a look at this example image and the highlighted list of negative prompts. These are used to exclude certain elements from the final image.

Use Detailed & Specific Prompts

This may seem very obvious, but it makes sense to take a moment to discuss the idea of specificity.

In general, when creating your Stable Diffusion prompts, it is always better to be as specific and detailed as possible. 

For example, you could generate an image with a simple prompt like ”A dog”, as shown below. And while this image is fine, it may not match the breed, camera angle, or lighting you want.

But if you tweak the prompt to be more specific with a more detailed description, the output changes. 

Consider this updated prompt and the image shown below.

AI Prompt:For the first prompt, imagine a playful Golden Retriever in a lush, green park. The dog is captured mid-jump, chasing after a frisbee. The camera used is a Nikon D850 DSLR with a 24–70mm f/2.8 lens. The resolution is set at 45.7 megapixels, ISO sensitivity at 64, and shutter speed at 1/8000 second. The lighting is natural, with the sun providing a warm, golden hue to the scene. The colors are vibrant and rich, with the green of the grass contrasting beautifully with the golden fur of the dog. The shot is taken from a low angle, emphasizing the dog’s energetic leap and joyful expression.

Notice the difference? The second image is noticeably more detailed and looks a lot better than the first one.

Good Stable Diffusion Prompt Examples

By now, you should have a solid understanding of how to create good prompts for Stable Diffusion. That said, let’s look at a range of prompt examples to help reinforce these concepts.

  • An illustration of a landscape with a mountain background in the style of light yellow and dark cyan, the grandeur of scale, large—scale murals, adventure pulp, animated gifs, prairie core, realistic color schemes
  • Layered transparency of the symbiogenesis inside a nuclear fusion alien dark cyborg, by Dan McCarthy, hyperrealistic, hdr, 8k, intricate details, ultra-realistic, painstaking attention to detail, highly detailed, high definition, award-winning, 4k
  • A blue shark with a painted face on an old wall, in the style of hyper-realistic sculptures, fragmented figures, distressed materials, tiled walls of light grays, cracked, rococo—inspired art
  • A woman in battle armor space suit, full body, a bio-borg on an alien planet, Desert barren rocky area during battle, science fiction, detailed eyes, hyper-detailed, symmetrical face, sharp focus, looking into the camera, chiaroscuro, professional, realistic, rough, gritty, Olivia de Berardinis
  • Award-winning cinematic bioluminescent oil creature design in gold, vibrant holographic gradient blue and silver colored scheme, in the style 3d hydro — drip venom character, ray tracing reflection, prismatic lighting, realistic texture detail, vibrant electric flames coursing through oil

Final Thoughts

While Stable Diffusion may have its complexities, there’s no denying that it’s an innovation that has and will continue to impact the field of AI. That’s why learning how to create the best Stable Diffusion prompts is essential.

By understanding the optimal prompt length, considering the key components of a good prompt, and leveraging the appropriate tools and platforms, users can unlock the full potential of Stable Diffusion to generate stunning and visually stunning images.

We hope you find this article helpful. If you have any additional tips to improve prompt engineering for Stable Diffusion, please share them in the comments.

New to the world of AI but hungry to learn more? Check out:

The Best AI Tutorials

Frequently Asked Questions

1. What Is the Ideal Prompt Length?

The ideal length for a Stable Diffusion prompt depends on the level of control you want to have over the image that is produced. In general, Stable Diffusion works better with specific and more detailed prompts, and this tends to mean longer prompts.

2. Does Stable Diffusion Allow NSFW Content?

Yes, various Stable Diffusion models have been fine-tuned with NSFW content. However, if you’re using the base model v2.0 and newer from Stability AI, it uses LAION’s NSFW filter to remove adult content. And while it’s possible to bypass this filter by modifying the model, it’s not advisable as it could result in the creation of harmful content.

3. What Is the Best Resolution for Stable Diffusion?

The optimal resolution for Stable Diffusion depends on your needs. The base text-to-image models in Stable Diffusion 2.0 generate images with default resolutions of 512x512 and 768x768 pixels. But remember, higher resolutions require more computational power and may increase processing times.

People are also reading:

By Jim Clyde Monge

A software engineer with 10 years of experience. Jim is a technical writer focused on Generative AI with over 4 million views on Medium. He is also a solopreneur and founder of https://talesfactory.app/. Jim loves to read and draw in his spare time.

View all post by the author

Subscribe to our Newsletter for Articles, News, & Jobs.

I accept the Terms and Conditions.

Disclosure: Hackr.io is supported by its audience. When you purchase through links on our site, we may earn an affiliate commission.

In this article

Learn More

Please login to leave comments