MrDeepFakes Forums

Some content may not be available to Guests. Consider registering an account to enjoy unrestricted access to guides, support and tools

  • We are looking for community members who are intested in helping out. See our HELP WANTED post.

[GUIDE] Using Stable Diffusion to generate custom NSFW images

Status
Not open for further replies.

1) Some background info on why I think this is promising (if you just want the guide you can skip this part):


I'm sure most of you around here have heard about OpenAI's Dall-E already. One of the latest developments in AI Vision, a program smart enough to generate any image from any prompt. Unfortunately, OpenAI (more like ClosedAI), censors Dall-E extremely hard, to the point where the only way to get NSFW content is to get super creative with your words to avoid all banned words, and even then, you'll need to have 50 throwaway email accounts and phone numbers ready to make new ones every time you get banned (which you will).

But I'm sure most of you have not heard that OpenAI now has some serious competition from an actually open source program: Stable Diffusion .

The Stable Diffusion software has been publicly available from the beginning on their github repo https://github.com/CompVis/stable-diffusion
Just 24 hours ago, they released their latest, most trained model yet publicly. This means that now anyone with a decent enough card can run it on their pc, 100% free, no trial/credits bullshit. A GPU with 8GB VRAM is recommended, but I run it fine on an old 6GB VRAM GPU with a slightly modified release that sacrifices generation time for lower VRAM usage - will be included in the guide below.

Now you might be wondering, "bro I tried NSFW on Dall-E, I get horror-movie bodies that i would wish I never looked at, how is this different". It's a good question. It's safe to assume that any startup company on the forefront of AI Vision, text-to-image generation will do their best to remove all NSFW from the training datasets, and even add NSFW filters in the software itself. So their NSFW generation capabilities would automatically suck, right? Is Stable Diffusion different? Well, from the company's own description, their model was trained on a subset of LAION-5B (a huge database of 5 billion captioned images). Of course they tried to eliminate all NSFW from that subset, but that's nearly impossible, and from their own admission around 3% of the dataset included "unsafe" images. They even offer a searchable index of the LAION-5B dataset, and if you uncheck safe mode and set aesthetic weight to 0, you will actually find TONS of captioned porn images in it, like you were literally searching on pornhub.


This tells me the model was in fact trained on tons of porn images as well, but they explicitly lowered the weight of those images in the training. But having played with this program a lot in the last 48 hours, and personally SEEN what it can do with NSFW, I guarantee you it can 100% assist not only in celeb fakes, but in completely custom porn that never existed or will ever exist. I know It sounds like I'm a salesman for Stability AI (their company), but I have nothing to gain from posting this, except for the hope that someone smarter and more knowledgeable than me will SEE what this program can do with a TRASH, TINY nsfw dataset, and actually train a model with a proper NSFW dataset, to usher a completely new era of AI porn generation. In fact I would be very surprised if the huge porn companies like pornhub don't already have 20 devs locked up in a basement working on a completely NSFW version of this, because it's a goldmine waiting to be made. The only headaches are legal, and we don't care much about that here anyway. So let's do it.

2) If you want to test/see samples before going through the installation (otherwise skip this part too):


  1. https://discord.gg/KgyQbMK8bs - Currently the largest AI Generated porn community. Warning: They changed rules to not accept celeb fakes, so keep it in mind if you do join. It includes a stable diffusion discord bot that anyone can use to generate images freely. It also includes various NSFW channels divided to subcategories based on genre, where users post their creations. It also includes lots of helpful resources such as how to fine tune the publicly available, 190k iteration stable diffusion model to perform better with porn (there's a dedicated channel for model training). In other words, it's a good place to be if you wanna stay up to date with the latest tips, tricks and developments in AI porn generation.
  2. https://neuralblender.com/create-art - This is a site that uses the stable diffusion model in case you wanna see what the results look like before you try installing it. You don't need to log in or create an account, and can create an unlimited amount of images (1 at a time). Simply enter your prompt in the text box, don't change any of the options (keep it at Free Tier, Phoebe Blend, 1 image), and click blend now. You will be redirected to the a "creation in progress" page, and you'll see a grey thumbnail with a spinning wheel on it. As soon as that thumbnail disappears, your creation is ready, but the site will not re-direct you. So you will have to manually click "my art" at the top to see the result. Rinse and repeat
  3. See comments in this thread of people that have already been using it and generating various images

3) Installation Guide


I highly recommend instead of following the copy pasted text that I include below, that you actually visit the direct source of the guide, as this is updated almost twice a day, with new features added all the time. The direct to the original, regularly updated guide is this. I'm copy pasting below the segment about installing it. Also, there are several other guides, including setting it up in google colab, but I don't wanna go that in depth. You can find more info about those in the discord community if you are interested


--GUIDE--​

*People on macOS instead of Windows who don't like following multiple steps can now try this 1 click installer instead: https://diffusionbee.com/

Step 1: Install Git (page)
-When installing, make sure to check the box for 'Windows Explorer integration -> Git Bash'

Step 2: Clone the WebUI repo to your desired location:
-Right-click anywhere and select 'Git Bash here'
-Enter git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
(Note: to update, all you need to do is is type git pull within the newly made webui folder)

Step 3: Download your preferred model(s):

  • Official Stable Diffusion 1.4: Huggingface (requires signup) or HERE | (magnet)
  • Waifu Diffusion Final: (SD 1.4 + 680k Danbooru images, heavy anime bias) HERE | (Float32 Ver.)
  • Waifu Diffusion Alpha: (SD 1.4 + 56k Danbooru images, slight anime bias) HERE | (mirror) | (magnet)
  • Trinart2: (SD 1.4 trained for Anime concept art/'Pixiv style') HERE
  • See This page for additional models (Most in beta)
Step 4: Rename your .ckpt file to "model.ckpt", and place it in the /models/Stable-diffusionfolder
-You can have as many models as you want in the folder, "model.ckpt" is just the one it will load by default

Step 5: Install Python 3.10 (Windows 7 ver) (page)
-Make sure to choose "add to PATH" when installing

Step 6 (Optional):
This reduces VRAM, and allows you to generate at larger resolutions or batch sizes for a <10% loss in raw generation speed
(For me, singular results were slightly slower, but generating with a batch size of 4 made each result 25% faster on average)
This is recommended for most users
-Edit webui-user.bat
-Change COMMANDLINE_ARGS= to COMMANDLINE_ARGS=--medvram

Step 7: Launch webui-user.bat, Open it as normal user, not as administrator.

  • Wait patiently while it installs dependencies and does a first time run.
    It may seem "stuck" but it isn't. It may take up to 10-15 minutes.
    And you're done!
Usage
  • Launch webui-user.bat
  • After loading the model, it should give you a LAN address such as '127.0.0.1:7860'
  • Enter the address into your browser to enter the GUI environment
    Tip: Hover your mouse over UI elements for tooltips about what they do
  • To exit, close the CMD window

RENDER TIME BY GPU (50 steps)
Time

SAMPLER COMPARISON
Sampler Comparison


4) Where do I find models to use? Which is the best?

This is currently the largest known site where all users share models. It has a LOT of things to pick from.
My general recommendations of models you HAVE to try:
1. F222 (predecessors: F111, F99). Best general NSFW model because of it's better ability than many other models to not fuck up legs/hands. It won't give you hardcore very easily, but for just nudes there is no better model
2. Blacked. Model trained on the famous Blacked porn studio, specifically POV BJ scenes. You gotta try it out if you wanna make some BJ images.
3. Bukkake. One of the weaknesses currently for stable diffusion is that no matter what you put in the prompt it's extremely hard to get facials. Bukkake solves this, BUT, you also need to uncheck the "restore faces" option in the UI (check the tip from the rentry sd models site regarding the bukkake model which explains this
4. Pyro's BJ model. Another good option for a BJ model, if you want a bit more variety than what the blacked model offers

Pro tip: Use the "merging" option in automatik's UI, merge one of the BJ models with Bukkake, and now you can generate BJ WITH facials

If you are really interested in Stable Diffusion and wanna learn everything there is, look no further than the resource goldmine:

 
Last edited:

lewutt

DF Pleb
For some reason it will no longer let me edit the original post, so I'm adding some extra info/disclaimers here

Of course you will have to generate a number of images before you get 1 that's good/passable. You have to remember that the devs did everything they could to prevent porn from the dataset. It's not gonna magically give you porn with the first porn prompt you try. But when you do get a really good image, it just proves to you what this can actually do if someone actually makes a NSFW model. Hint: Try a prompt like this: "naked skinny russian girl, single subject, full body, scenic full shot, ambient lighting"
If dezgo.com is too slow for you, you can also try https://neuralblender.com/ . This one actually has a credit system, but for testing purposes you can generate only 1 image at a time for free, with no limit. Click "blend now" and select "Phoebe Blend Beta" as "art style" (that's stable diffusion). For more prompts use your imagination, experiment, or find more from that discord community.
 

TMBDF

Moderator | Deepfake Creator | Guide maintainer
Staff member
Moderator
Verified Video Creator
How about some examples? That's a lot of shit to go through without being able to see results, unliked deepfakes this is a new method to do NSFW, people will want to see it in action before they decide to go through the initial setup process which seems like a bit of an hassle and definitly not a quick, 1 minutes setup with DFL where you unpack a file and there you go.
 

lewutt

DF Pleb
How about some examples? That's a lot of shit to go through without being able to see results, unliked deepfakes this is a new method to do NSFW, people will want to see it in action before they decide to go through the initial setup process which seems like a bit of an hassle and definitly not a quick, 1 minutes setup with DFL where you unpack a file and there you go.
I linked 2 free sites that are using stable diffusion where people can write prompts and have a generation in a matter of seconds (0 setup or installation needed) and also provided a sample prompt you can use. Wasn't sure if I can actually attach NSFW stuff in the post itself. But I'll add some here then (I still urge people to test it for themselves)

Here's to imgur galleries of results I found on reddit.com/r/porndiffusion:



And I'm also attaching below various images from the discord community I linked above (some of them have the prompt itself in the filename, some don't)
 

Attachments

  • SD17.png
    SD17.png
    568.3 KB · Views: 52,211
  • miley_cyrus_bent_over_spreading_her_ass_cheeks._sexy_photoshoot.png
    miley_cyrus_bent_over_spreading_her_ass_cheeks._sexy_photoshoot.png
    395.7 KB · Views: 28,787
  • Zendaya_oiled_nude_kinky_photoshoot.png
    Zendaya_oiled_nude_kinky_photoshoot.png
    409.4 KB · Views: 44,038
  • Miley_cyrus_nude_sexy_selfie.png
    Miley_cyrus_nude_sexy_selfie.png
    552.4 KB · Views: 42,014
  • white_princess_12.png
    white_princess_12.png
    421.1 KB · Views: 50,700
  • seed_623799_00026.png
    seed_623799_00026.png
    433.6 KB · Views: 54,786
  • emma_watson_but_with_big_perky_breasts_nipple_showing_full_body_beautiful_face_photo_image_por...png
    emma_watson_but_with_big_perky_breasts_nipple_showing_full_body_beautiful_face_photo_image_por...png
    459.3 KB · Views: 44,475
  • emma_watson_but_with_big_perky_breasts_nipple_showing_full_body_beautiful_face_photo_image_por...png
    emma_watson_but_with_big_perky_breasts_nipple_showing_full_body_beautiful_face_photo_image_por...png
    384.5 KB · Views: 27,861
  • emma_watson_slutty_playboy_bimbo_photorealistic_image_posing_topless_metart_brazzers_pornhub_l...png
    emma_watson_slutty_playboy_bimbo_photorealistic_image_posing_topless_metart_brazzers_pornhub_l...png
    377.3 KB · Views: 29,062
  • emma_watson_but_with_big_perky_breasts_nipple_showing_full_body_beautiful_face_photo_image_por...png
    emma_watson_but_with_big_perky_breasts_nipple_showing_full_body_beautiful_face_photo_image_por...png
    322.7 KB · Views: 42,180

TMBDF

Moderator | Deepfake Creator | Guide maintainer
Staff member
Moderator
Verified Video Creator
One could certainly improve these with a deepfake on top, maybe even generate decent approximations for other angles (Emma Watson looking at the sky with expression of pleasure/open mouth) :D
 

lewutt

DF Pleb
For sure it can be used in combination with deepfakes, but in my opinion this technology will soon overtake what we currently do with deepfakes. I even saw a text to video application from some other people. We are at very early stages and this technology is improving exponentially daily.

Also I didn't mention anywhere in my original post that it can also do img2img (also not included in the sites i linked yet - only if you actually install it or try it from a colab notebook). What this does is, you take an existing image, you throw a prompt to go with it, and it generates a variation of that image based on your prompt. A lot of people use this feature for porn specifically. Like adding a picture of emma watson and then a prompt "emma watson drenched in cum" with an average strength lvl setting like 0.3 and... you know.
 

666VR999

DF Enthusiast
really appreciate the effort you've gone to with this, thank you, not had chance to try it myself but I'm really really interested in it.
 

lewutt

DF Pleb
UPDATE:
A few pointers i wanted to highlight about the original post:

1. The dezgo site for testing without installing seems to be extremely slow nowadays. I recommend going on neuralblender instead if you want to test before trying to install. It's monetized but it lets you create 1 image at a time (unlimited amount of times) for free, no need to make an account, and the generation is much faster than dezgo (usually 5 seconds for 1 image). You click "blend now", then you enter your prompt, don't change tier or art style (keep them to "free" and "phoebe blend"), scroll down, click the "blend now" button. You'll be redirected to the "creation in progress page" and you'll see a grey thumbnail with a spinning cogwheel showing you that the prompt is being generated. As soon as that thumbnail disappears, it finished generating. The site's creator did not make it redirect you automatically to your creation, so you'll be stuck on the "creation in progress" page even after it finishes. Just manually click the "My Art" section at the top to go to your images. Rinse and repeat.

2. Instead of reading the instructions from the copy pasted guide in my post, I suggest you go directly to the source of the guide (the https://rentry.org/kretard link that I already included) - since this guide is actually being updated daily with new features and stuff. I can't edit my original post or keep up with all the new changes.

3. If you have the time and energy to try to experiment with fine tuning the model that the original developers gave us, and make it deal with NSFW better, here's a guide to get you started: https://pharmapsychotic.com/training.html

4. And here's another model training guide, but minimal coding required: https://peakd.com/hive-158694/@kali...nditional-diffusion-model-with-minimal-coding
 

sweetpepperpie

DF Vagrant
UPDATE:
A few pointers i wanted to highlight about the original post:

1. The dezgo site for testing without installing seems to be extremely slow nowadays. I recommend going on neuralblender instead if you want to test before trying to install. It's monetized but it lets you create 1 image at a time (unlimited amount of times) for free, no need to make an account, and the generation is much faster than dezgo (usually 5 seconds for 1 image). You click "blend now", then you enter your prompt, don't change tier or art style (keep them to "free" and "phoebe blend"), scroll down, click the "blend now" button. You'll be redirected to the "creation in progress page" and you'll see a grey thumbnail with a spinning cogwheel showing you that the prompt is being generated. As soon as that thumbnail disappears, it finished generating. The site's creator did not make it redirect you automatically to your creation, so you'll be stuck on the "creation in progress" page even after it finishes. Just manually click the "My Art" section at the top to go to your images. Rinse and repeat.

2. Instead of reading the instructions from the copy pasted guide in my post, I suggest you go directly to the source of the guide (the https://rentry.org/kretard link that I already included) - since this guide is actually being updated daily with new features and stuff. I can't edit my original post or keep up with all the new changes.

3. If you have the time and energy to try to experiment with fine tuning the model that the original developers gave us, and make it deal with NSFW better, here's a guide to get you started: https://pharmapsychotic.com/training.html

4. And here's another model training guide, but minimal coding required: https://peakd.com/hive-158694/@kali...nditional-diffusion-model-with-minimal-coding
anyway to use it like an alternative to deepsukebe? where id like to keep the same face of someone or image and body and just make them naked?
 

plowsleuth

DF Vagrant
I'm getting error "Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases"

Double checked kdiff.py file it is saved as .py not .txt in "all file" format. Any suggestions would be appreciated!
 

lewutt

DF Pleb
I'm getting error "Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases"

Double checked kdiff.py file it is saved as .py not .txt in "all file" format. Any suggestions would be appreciated!
If I had to guess where you made a mistake it's probably step 8 or step 10. I remember that the first time I tried to install this and tried to run a command I got that error too. I deleted everything and tried again from the beginning. Turns out while the conda env create -f environment.yaml command was running I closed the window because I thought it finished adding all the dependencies and stuff and was just stuck. It was still downloading/installing things and they got corrupted because I stopped it.

Also make sure you're following the guide directly from the source (the one that's updated regularly) and not the copy pasted version in my post.
 
D

[deleted]

Guest
Got it working locally. Here's some fakes I generated of Taylor Swift. Didn't save the prompts sadly, might do another run and save them.

Pretty crazy results considering how little nsfw material is actually in the dataset. Weak point is obviously the face, but that's sure to improve over time.


5Vv0H9Y.png


Full gallery: https://imgur.com/a/atWzV3X

Some other weird experiments I tried lmao:
1661470127531.png
 
Last edited:

deepfakehk

DF Vagrant
I linked 2 free sites that are using stable diffusion where people can write prompts and have a generation in a matter of seconds (0 setup or installation needed) and also provided a sample prompt you can use. Wasn't sure if I can actually attach NSFW stuff in the post itself. But I'll add some here then (I still urge people to test it for themselves)

Here's to imgur galleries of results I found on reddit.com/r/porndiffusion:



And I'm also attaching below various images from the discord community I linked above (some of them have the prompt itself in the filename, some don't)

Thanks for sharing! May I know how to generate such a clear face without distortion?
 

deepfakehk

DF Vagrant
Status
Not open for further replies.
Top