[Tutorial] Beginner’s Guide to Stable Diffusion NSFW/Hentai Generation

There isn’t any very clear material on how to use Stable Diffusion for NSFW/nude/hentai generation, so today I’m going to go over the following in detail:

  • How to download NSFW Stable Diffusion models (don’t use the base Stable Diffusion models (SD V1.5 or V2.1 or SDXL. People have created custom models on top of the base models that are much better at everything, especially NSFW content.)
  • How to install AUTOMATIC1111 Stable Diffusion WebUI (we need a interface to generate with, WebUI just means the interface is web browser based)
  • Downloading LoRAs and embeddings (additional files) to improve your results
  • Getting started with NSFW prompting and generation
  • Getting started with creating NSFW animated GIFs

This guide is intended as an primer and overview to get you generating quality NSFW images as quickly as possible. If you follow this guide exactly you’ll be able to generate the following images:

I also recommend these guides as supplemental reading:

Afterwards, you’ll also be able to generate any image you find in the BetterWaifu prompt app.

Let’s get started!

1. Download a Stable Diffusion NSFW checkpoint model

Civitai.com is the home of NSFW models. Civitai will only show you the NSFW models if you have an account. 

Sign up for an account and then go to your settings (Top right Account button > Account settings) and turn on Show me adult content and turn off Blur adult content.

Now you can see all NSFW models.

As an example, I’m going to download Chilloutmix, a great NSFW model.

Models come in either checkpoint (.ckpt) or safetensor (.safetensor) format, both are fine, but .safetensor is safer.

2. Install AUTOMATIC1111’s Stable Diffusion WebUI

This is the user interface you will use to run the generations.

Skip this step if you already have AUTOMATIC1111 WebGUI installed.

Installation instructions for different platforms:

You might not want to run Stable Diffusion locally for any number of reasons: Your graphics card is not good enough. You don’t have enough hard drive space etc etc. Not a problem, you can run it in the cloud with Google Colab.

When the installation is complete, you will have a folder somewhere on your hard drive called stable-diffusion-webui. Or if you’re doing Google Colab follow their instructions.

Place the model in the Web UI folder

After your model file (.cpkt or .safetensor) is finished downloading, place it in the folder stable-diffusion-webui/models/Stable-diffusion

(stable-diffusion-webui is folder containing the WebUI you downloaded in the first step)

Google Colab setups normally require you upload this model to Google Drive and connect the notebook to Google Drive.

Start the WebUI

  • Windows: double-click webui-user.bat to start
  • Linux: run webui-user.sh to start
  • Mac: run ./webui.sh to start

You will know it’s ready when you see the line Running on local URL: http://127.0.0.1:7860

Go to this address in your web browser: http://127.0.0.1:7860

You’ll notice at the top there’s a toggle called “Stable Diffusion Checkpoint”.

You can use this to switch to any of the NSFW models you have placed in the stable-diffusion-webui/models/Stable-diffusion folder.

You can go back to civitai.com and download as many models as you want. After placing models in the stable-diffusion-webui/models/Stable-diffusion folder make sure you click the refresh button.

3. Download LoRAs

By now you can already start prompting and getting results.

However, for best results, I recommend picking up some LoRAs.

What are LoRAs? They’re smaller models trained on a specific subject (such as an art style, a character, a body type, a sex act etc).

Basically you use them in combination with the checkpoint model you downloaded in the first step. There are LoRAs for everything, and people keep on making more of them.

Thankfully, LoRAs have much smaller file sizes than checkpoint models. And you can use as many LoRAs as you want in a single prompt.

You activate your LoRAs by adding a special phrase inside your prompt. We’ll get to that in a bit.

I’m going to download the following popular LoRA breastInClass for this example, a LoRA that creates bodies with better proportions.

After downloading this .safetensor file, place it in the folder stable-diffusion-webui/models/Lora

3. Download Embedding

This step is optional, but highly recommended because it will make your images higher quality.

Think of embeddings as a snapshot of a lot of concepts. We normally use negative embeddings: by putting lots of negative concepts such as “bad quality image” in our negative prompts, we get better images.

Download the embedding called easynegative. Then place this file in the folder stable-diffusion-webui/embeddings.

4. Prompt!

By now you should have downloaded the following files:

  • ChilloutMix and placed it in stable-diffusion-webui/models/Stable-diffusion
  • breastInClass and placed it in stable-diffusion-webui/models/Lora
  • EasyNegative and placed it in stable-diffusion-webui/embeddings

Reload/restart your WebUI (scroll to the footer, click Reload UI).

In the prompt field, copy and paste this prompt:

8k, RAW photo, highest quality, masterpiece, High detail, RAW color photo, professional close-up photo, (realistic, photo realism:1. 37), (highest quality), (best shadow), girl sitting by the pool side ,nude ,(naked:1.2), blonde, spreading pussy, (spreading thigh:1.4), butterfly legs, photorealistic, looking at viewer, beautiful detailed eyes, light on face, (fullbodyshot:1.1),Particularly strong light, Feminine Expressions, (small breast:1.4), skinny body, white skin, ((erotic, sexy, horny)) ultra high resolution, highly detailed CG unified 8K wallpapers, physics-based rendering, cinematic lighting, ((good anatomy:1.2)),detailed areolas, detailed nipples, detailed breasts, (extremely detailed pussy),detailed face <lora:breastinclassBetter:0.2>

In the negative prompt field, copy and paste this prompt:

easynegative, muscular, (suntan:2), (sleeves:2), (tattoo:2), (sunglasses:2), (inverted nipples), (mutated:2), (worst quality:2), (low quality:2), (normal quality:2), lowres, blurry, ((nasolabial folds):1.2), 3d, anime, cartoon, cg, comic, drawing, bad detailed background, cropped, grayscale, jpeg artifacts, monochrome, non-linear background, out of frame, paintings, poorly drawn, semi-realistic, sepia, sketches, unclear architectural outline, asymmetric eyes, bad anatomy, cloned, crooked teeth, deformed, dehydrated, disfigured, double nipples, duplicate, extra arms, extra fingers, extra legs, extra limbs, long fingers, long neck, malformed limbs, missing arms, missing legs, missing teeth, more than five fingers on one hand:1.5, more than two arm per body:1.5, more than two leg per body:1.5, mutated, mutation, mutilated, odd eyes, ugly, (artist name:2), (logo:2), (text:2), (watermark:2), acnes, age spot, dark spots, fat, fused, giantess, glans, mole, obesity, skin blemishes, skin spots, animal ears, elf-ears, earrings, childish, morbid

Some notes on the above:

  • Notice how the LoRA is used at the end of the prompt
    <lora:FILENAME_OF_LORA_WITHOUT_EXTENSION:WEIGHT>
    Where weight is a number from 0-1 describing how strong you want the effect of the LoRA to be. Shortcut: you can click on the LoRA tab underneath the negative prompt to see all your LoRAs (click refresh if you don’t see anything), and click on them to automatically add the LoRA phrase to your prompt.
  • Inside the negative prompt you’ll also see the embedding “easynegative”: all you have to do is mention its name to use it.

Change the following settings:

  • Set the height slider to 768 and keep the width at 512 to create a nicer aspect ratio more suitable for portraits.
  • Change the Sampling method to DPM++ 2M Karras. This is a very versatile sampling method that I use for 80% of my generations.
  • Set the seed to 3740919403. The number itself doesn’t matter, but the same seed with the same settings and prompt will always produce the same image. So you can reliably reproduce the images in this guide if you use the same seed as me.

Then click Generate! Here’s what I get:

If you’re getting bad/ugly results, make sure you have the LoRA and embedding downloaded, placed in the proper folders, and used correctly in your positive and negative prompts. Also make sure you are using the DPM++ 2M Karras sampling method.

We’re not doing anything fancy here. The only things we’ve changed from the default settings is increasing the height, changing the Sampling method, and setting a Seed value.

You can also click the dice next to the Seed field to change the seed to -1, which just means “random seed every time”. This will produce a unique image every time you generate.

Here are some variations of our prompt with random seeds:

Next, let’s try a sex act.

Here’s a shortcut: instead of copying each prompt over and manually adjusting the settings, copy this whole block into your Prompt field. Then press the blue button under the “Generate” button and AUTOMATIC1111 will automatically fill everything in for you.

(1boy, 1girl, penetration,girl lying on back, spread legs:1.6) (a girl having sex in a missionary position:1.2) (missionary sex, sex, penis in pussy, pussy out, lying in bed, orgasm face, blush, sweaty) beautiful, masterpiece, best quality, extremely detailed face, perfect lighting (skinny) ((puffy eyes)),small breasts, swept bangs,walking,outdoors,sunshine,light_rays,fantasy,rococo,hair_flower,low tied hair, smile,half-closed eyes, ,dating,(Nude), nsfw, (heavy breathing:1.2) ,tears, crying, blush, wet, sweat, <lora:breastinclassBetter:0.1>

Negative prompt: paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot,(ugly:1.331), (duplicate:1.331), (morbid:1.21), (mutilated:1.21), (tranny:1.331), mutated hands, (poorly drawn hands:1.331), blurry, (bad anatomy:1.21), (bad proportions:1.331), extra limbs, (disfigured:1.331), (missing arms:1.331), (extra legs:1.331), (fused fingers:1.61051), (too many fingers:1.61051), (unclear eyes:1.331), bad hands, missing fingers, extra digit, bad body,pubic

Steps: 25, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 1410211169, Size: 512x768, Model hash: fc2511737a, Model: chilloutmix_NiPrunedFp32Fix, Lora hashes: "breastinclassBetter: d62716438a56", Version: v1.6.0
The blue arrow button underneath “Generate”

Then simply click Generate. Here’s what I get:

Here are some other generations with the same prompt, but a random seed:

Different models are better at different things. You should check out this list of NSFW models for other recommendations.

Chilloutmix is not actually that great at sex, which is why this prompt produces unpredictable results. The ones above have been cherry-picked for your entertainment.

Hentai using Anime Model

Now let’s create some Hentai using an anime model.

Download the model DarkSushiMix, which is a very good anime model. Place it in your models folder stable-diffusion-webui/models/Stable-diffusion.

Make sure you select this model in the Stable Diffusion checkpoint field: (click the blue refresh button if you don’t see it).

Use the follow prompt and settings (same method as before, copy and paste this to your prompt field and then click the blue arrow underneath the Generate button):

masterpiece, best quality, beautiful lighting, (1boy, 1girl, penetration, spread legs, a girl having sex in a missionary position:1.2) (sex, penis in pussy, pussy out, lying in bed, orgasm face, blush, sweaty) nude nsfw, long hair, skinny, wide hips, medium breasts,
Negative prompt: paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot,(ugly:1.331), (duplicate:1.331), (morbid:1.21), (mutilated:1.21), (tranny:1.331), mutated hands, (poorly drawn hands:1.331), blurry, (bad anatomy:1.21), (bad proportions:1.331), extra limbs, (disfigured:1.331), (missing arms:1.331), (extra legs:1.331), (fused fingers:1.61051), (too many fingers:1.61051), (unclear eyes:1.331), bad hands, missing fingers, extra digit, bad body,pubic

Steps: 25, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 338664335, Size: 512x768, Model hash: cca17b08da, Model: darkSushiMixMix_225D, Version: v1.6.0

You should get this result:

Animated NSFW GIFs and Videos

You can actually produce short animations of all the images above!

I’m in the middle of writing this guide out.

In the meantime, you can download AnimateDiff extension (external link) and run all of the same prompts above. You will need minimum 8GB VRAM with an NVIDIA GPU to do this.

In addition, you must cut your prompt and negative prompt to below 75 tokens (token count is displayed in the top right corner of prompts) for this to work.

Here’s what you can do right now:


Next Steps

You can check out these basic prompts for where to get next:

Here’s a discord I made for sharing prompts.

New NSFW discord

I also highly recommend experimenting with combinations of popular LoRAs and models and seeing what you get:

Happy hentai prompting!

22 thoughts on “[Tutorial] Beginner’s Guide to Stable Diffusion NSFW/Hentai Generation”

  1. Hello, thanks for the guide. I am completely stuck. I have followed these instruction. I also tried different models and LoRA-s. Can anyone help why I always get blurry images with a sort of washed up colors?

    Reply
  2. Is there a way for the face’s model to be our own trained model? Because I want to use specific face (let’s say a celebrity)

    Reply
  3. NansException: A tensor with all NaNs was produced in Unet. This could be either because there’s not enough precision to represent the picture, or because your video card does not support half type. Try setting the “Upcast cross attention layer to float32” option in Settings > Stable Diffusion or using the –no-half commandline argument to fix this. Use –disable-nan-check commandline argument to disable this check. I don’t understand this error, can you help me?

    Reply
  4. very good, tho, I noticed that my positive prompt is 144/150, compared to the example of 147/150, not sure if I missed something, but very good otherwise

    Reply
  5. great work, tho, have a question, is there a big difference when my positive prompt is 144/150 and the example prompt is 147/150, trying to recreate as close as I can the example photo, thank you!!!

    Reply
  6. When adding LORAs and Models, you should have everyone install the EasyNegative “embedding” that is used in your negative prompt. Also, would like to see your seed value to try to replicate your images. Great guide, this has become my go to!

    Reply
  7. This is a wonderfully and selflessly constructed tutorial. You should be very pleased with yourself. I knew most of this already. (Not surprising; it’s an intro.) And even still — I learned something new. Much thanks for getting newbies, and apparently me, up to speed.

    Cheers!!

    Reply

Leave a Comment