Stable Diffusion is a powerful AI image generation tool, but it can sometimes create unwanted NSFW (not safe for work) content if not properly constrained. Applying carefully crafted prompts and negative prompts is key to guiding Stable Diffusion to generate safe and ethical imagery.
This article provides a comprehensive set of negative prompt examples to avoid NSFW content when using Stable Diffusion. It also covers best practices for prompt engineering to further steer the AI away from generating sexualized or offensive images.
Why Negative Prompts Matter
Negative prompts give you control over what does NOT appear in AI-generated images. They allow you to establish ethical and creative boundaries by specifying content the AI should avoid.
Without negative prompts, Stable Diffusion may inadvertently include:
- Nudity
- Revealing poses
- Sexual acts or suggestions
- Violence
- Harmful stereotypes
Applying targeted negative prompts reduces risks and leads to more usable results.
Best Practices
Follow these prompt engineering best practices when using Stable Diffusion:
Be Specific
Include details about unwanted content types, poses, camera angles, etc. Vague negative prompts are less effective.
Use Multiple Prompts
Chain several negative prompts together with commas to establish firmer boundaries.
Experiment and Iterate
Refine prompts through multiple generations to home in on ideal results. What works well for one prompt may not suit another.
Negative Prompt Examples
Here are negative prompt examples organized by category:
General NSFW Content
nsfw, nude, pornography, genitals, breasts, buttocks, underwear, lingerie, swimsuit, bikini, sex, sexual
Revealing Poses / Camera Angles
seductive, alluring, tempting, erotic, lewd, lurid, obscene, indecent, suggestive, explicit, revealing, upskirt, downblouse
from below, low angle, worm's eye view, bottom-up perspective
Ethical Concerns
child, minor, underage, rape, assault, abuse, violence, gore, mutilation, torture, cruelty
racist, sexist, bigoted, hateful, offensive, discrimination, stereotype
illegal, unethical, immoral, dangerous, harmful
Advanced Techniques
In addition to negative prompts, also consider:
Defining Allowed Content
Specify exactly what SHOULD be included to further narrow potential outputs:
clothed, dressed, garment, outfit, costume, uniform, armor, clothing
Weighted Prompts
Increase emphasis on key prompts by assigning a higher sampling weight:
clothed:2.0, dressed:2.0
Stylized Rendering
Generate a painting, illustration or other medium to steer away from photorealism:
ink drawing, animation, pixel art
Conclusion
With the right set of negative prompts tailored to your specific needs, you can eliminate AI-generated NSFW content from Stable Diffusion. Take time to carefully engineer prompts, run multiple generations, and refine based on results.
Implementing the recommendations in this guide will lead to more ethical, safe-for-work AI art that unlocks the creative potential of this technology while establishing important boundaries.
Useful Websites
- LAION Open Dataset – The open source training data for Stable Diffusion
- Stable Diffusion Discord – Discuss best practices with the Stable Diffusion community
- PromptMania – Browse and build a library of prompts