When using AI image generation models like Stable Diffusion, it is important to provide clear guidance on what type of content you want to generate or avoid generating. Negative prompts are an effective way to specify undesirable elements to exclude from generated images. This is especially relevant for Not Safe For Work (NSFW) content.
In this article, I will provide useful negative prompt examples to prevent NSFW content when using Stable Diffusion. I have organized the prompts into categories covering common issues that can arise. My goal is to showcase expertise on this topic by highlighting impactful negative prompts while using an informative tone.
What Are Negative Prompts
A quick definition before diving into the examples:
Negative prompts are words and phrases included in your text prompt that tell the AI model what not to include in the generated image. They act as guard rails, steering the image generation away from unwanted elements.
Including targeted negative prompts along with your main text prompt allows greater control over the output. Now let’s look at prompt examples for avoiding NSFW content specifically.
Negative Prompts to Exclude Nudity
Preventing nudity and revealing outfits is usually a top priority for SFW image generation. Here are negative prompts that target various aspects of nudity:
Direct Nudity Terms
nsfw, nude, naked, topless, underwear
These direct terms make it clear to avoid nudity.
Revealing Clothing
lingerie, see-through, transparent clothes, wardrobe malfunction
Block revealing outfits and clothing mishaps.
Body Parts
exposed genitals, exposed breasts, exposed butt, exposed midriff
Call out body areas that should be covered up.
Sexual Content
sex, sexual, pornographic
Prohibit sexual themes and pornography.
Artistic Nudity
tasteful nudity, artistic nudity
Even tasteful nude depictions should be blocked for SFW generation.
Nudity Detection
censor bar, black bar, pixelated
Have the model censor nudity instead of generating it.
Negative Prompts for Other NSFW Content
Beyond nudity, there are other unsavory elements that negative prompts can help avoid.
Violence and Gore
gore, mutilated, decapitated, blood, violence
Avoid disturbing violent and gory content.
Profanity and Vulgarity
swear words, vulgar sign
Profanity has no place in SFW images.
Drugs and Alcohol
drugs, smoking, alcohol, drinking
Images depicting illegal drug use or underage drinking should not be generated.
Ethically Problematic Content
harmful, unethical, racist, sexist
Guard against imagery that promotes unethical worldviews.
Improving Negative Prompts
There are some best practices around negative prompts that can improve their effectiveness:
- Use specific and unambiguous terms.
- Try combining related terms like “naked OR nude”.
- Weight prompts by appending a strength modifier like “:1.2”.
- Experiment with different prompts and judge the results.
- Curate prompt lists for different content types.
Example Weighted Prompts
Here is an example prompt with weighted negative terms:
A beautiful fairy princess in a magical forest, wearing an elegant green dress | nude:-1.2, topless:-1.2, lingerie:-1.0, transparent:-1.0
The higher weighting on “nude” and “topless” signals those are the most important prompts to enforce.
Conclusion
Carefully crafted negative prompts empower users to steer AI image generation away from creating unwanted NSFW content. I have outlined common prompt examples to exclude various types of nudity, gore, vulgarity and unethical content. Additionally, tips on improving prompts can further enhance control over the image creation process. With practice, negative prompts become an invaluable tool for SFW AI artistry.
Useful Resources
Here are some websites with more negative prompt examples and guidance:
Citations:
[1] https://stable-diffusion-art.com/how-to-use-negative-prompts/
[2] https://thegradient.pub/prompting/
[3] https://support.landing.ai/docs/visual-prompting
[4] https://builtin.com/data-science/recommender-systems
[5] https://generativeai.pub/100-negative-prompts-everyone-are-using-c71d0ba33980?gi=50f4b539512d
[6] https://blog.paperspace.com/prompt-based-learning-in-natural-language-processing/
[7] https://yossigandelsman.github.io/visual_prompt/
[8] https://www.iteratorshq.com/blog/an-introduction-recommender-systems-9-easy-examples/
[9] https://www.reddit.com/r/StableDiffusion/comments/y2s0fi/what_have_you_found_to_be_the_best_negative/?rdt=56112
[10] https://dev.to/avinashvagh/understanding-the-concept-of-natural-language-processing-nlp-and-prompt-engineering-35hg
[11] https://jerryxu.net/IMProv/
[12] https://promptengineering.org/using-large-language-models-for-recommendation-systems/
[13] https://huggingface.co/spaces/stabilityai/stable-diffusion/discussions/7857
[14] https://engineering.rappi.com/prompting-the-new-era-of-natural-language-processing-6494d828a9b9?gi=a7e7afc203ee
[15] https://prompthero.com/realistic-vision-prompts
[16] https://www.linkedin.com/pulse/can-we-give-better-recommendations-using-gpt-3-prompt-panchal
[17] https://www.greataiprompts.com/imageprompt/what-is-negative-prompt-in-stable-diffusion/
[18] https://en.wikipedia.org/wiki/Prompt_engineering
[19] https://blog.roboflow.com/compare-zero-shot-model-prompts/
[20] https://www.altexsoft.com/blog/recommender-system-personalization/
[21] https://blog.daisie.com/expert-tips-on-using-negative-prompts-for-stable-diffusion-success/
[22] https://www.promptingguide.ai/introduction/examples
[23] https://paperswithcode.com/task/visual-prompting
[24] https://blog.daisie.com/understanding-stable-diffusion-negative-prompts-a-comprehensive-guide/
[25] https://arxiv.org/pdf/2209.00647.pdf