Generating AI images with StableDiffusion - Beginner Guide

Richard Perkins

Well-Known Member
Jul 15, 2017
1,271
748
Here and there I will post some ideas with prompts and Loras (if used)

Today I fancied some pictures in the style of NTRMAN

Example #1

You don't have permission to view the spoiler content. Log in or register now.
You don't have permission to view the spoiler content. Log in or register now.
You don't have permission to view the spoiler content. Log in or register now.

Result:
View attachment 4301185


Example #2

You don't have permission to view the spoiler content. Log in or register now.
You don't have permission to view the spoiler content. Log in or register now.
You don't have permission to view the spoiler content. Log in or register now.

Result:
View attachment 4301236 View attachment 4301240 View attachment 4301243 View attachment 4301247

Bonus Pictures:
You don't have permission to view the spoiler content. Log in or register now.
where do you put the loras in
 

Guess_Who

Member
Mar 17, 2024
236
581
where do you put the loras in
I'm also a beginner but I would say here:
lora.PNG
---------------------------------------------------------------------------




I have a different problem. I downloaded it and also the other stuff like the Adons ADetailer. Controlnet I'm not sure if I have it since only ADetailer was shown......
I made also UI settings like you showed Psan2022 . I can open the site to get to the interface. That above is a screenshot from my screen.
My problem is that I can't load in the Stable Diffusion checkpoint. I downloaded the prefectpony. The version you gave the link and a new version but it doesn't open... . I have them placed in the correct path as you showed.
I get the following message after it tries to load it in:

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)


Stable diffusion model failed to load

Failed to create model quickly; will retry using slow method.
loading stable diffusion model: JSONDecodeError


When I start up the run.bat it also says it can't find certain modules:

Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2
Launching Web UI with arguments: --disable-safe-unpickle
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
[-] ADetailer initialized. version: 24.11.1, num models: 10
*** Error loading script: main.py
Traceback (most recent call last):
File "Z:\sd.webui\webui\modules\scripts.py", line 515, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "Z:\sd.webui\webui\modules\script_loading.py", line 13, in load_module
module_spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "Z:\sd.webui\webui\extensions\openpose-editor\scripts\main.py", line 14, in <module>
from basicsr.utils.download_util import load_file_from_url
ModuleNotFoundError: No module named 'basicsr'
 

Psan2022

Newbie
Mar 8, 2022
94
138
where do you put the loras in
Into your Stable Diffusion folder. (The folder you start the "webui-user.bat" from) -> webui\models\Lora

After that, go to the Lora tab and reload the screen. The Lora should show up.

I have a different problem. I downloaded it and also the other stuff like the Adons ADetailer. Controlnet I'm not sure if I have it since only ADetailer was shown......
I made also UI settings like you showed Psan2022 . I can open the site to get to the interface. That above is a screenshot from my screen.
My problem is that I can't load in the Stable Diffusion checkpoint. I downloaded the prefectpony. The version you gave the link and a new version but it doesn't open... . I have them placed in the correct path as you showed.
The errors seem to come from Openpose. Maybe that is also why Controlnet is not showing up. If you have a freshly downloaded Stable Diffusion with a new version it also may be that the Addons are not cought up yet. So they may not work until they get updated.

You can uncheck the Controlnet Addon under Settings/Extentions and restart the UI. See if the error is still there. You can also delete the "sd-webui-controlnet" folder under "webui\extensions". You can backup the Openpose modules you have donloaded (if you have downloaded any yet).

I suggest also to activate xformers.
Rightclick on the webui-user.bat und open it in the editor put --xformers as an argument and save -> Restart the Application/Server.
1734466437893.png

xformers may also speed up your generation process.

Regarding the checkpoints that are not working. Try without the Controlnet Addon first (just disable it and delete the folder as mentioned above). Reload the UI and see if the issue persists. If yes
Did you put your checkpoints here->
1734466569157.png
After that, reload the checkpoint list (blue arrow button).

If it is still showing an error while loading the checkpoint please tell me

edit: Your ControlNet folder should look something like this:
1734467341206.png
 
Last edited:

Guess_Who

Member
Mar 17, 2024
236
581
Into your Stable Diffusion folder. (The folder you start the "webui-user.bat" from) -> webui\models\Lora

After that, go to the Lora tab and reload the screen. The Lora should show up.



The errors seem to come from Openpose. Maybe that is also why Controlnet is not showing up. If you have a freshly downloaded Stable Diffusion with a new version it also may be that the Addons are not cought up yet. So they may not work until they get updated.

You can uncheck the Controlnet Addon under Settings/Extentions and restart the UI. See if the error is still there. You can also delete the "sd-webui-controlnet" folder under "webui\extensions". You can backup the Openpose modules you have donloaded (if you have downloaded any yet).

I suggest also to activate xformers.
Rightclick on the webui-user.bat und open it in the editor put --xformers as an argument and save -> Restart the Application/Server.
View attachment 4344749

xformers may also speed up your generation process.

Regarding the checkpoints that are not working. Try without the Controlnet Addon first (just disable it and delete the folder as mentioned above). Reload the UI and see if the issue persists. If yes
Did you put your checkpoints here->
View attachment 4344763
After that, reload the checkpoint list (blue arrow button).

If it is still showing an error while loading the checkpoint please tell me

edit: Your ControlNet folder should look something like this:
View attachment 4344784
I deleted everything before you replied and will later install everything from the start. Now I have a dumb question: Do I have to install it into the C: drive or doesn't it matter? Last time I installed it into the Z: drive......
Just want to make sure!
If I get the same errors again I will follow the steps you've shown above.
 

Psan2022

Newbie
Mar 8, 2022
94
138
I deleted everything before you replied and will later install everything from the start. Now I have a dumb question: Do I have to install it into the C: drive or doesn't it matter? Last time I installed it into the Z: drive......
Just want to make sure!
If I get the same errors again I will follow the steps you've shown above.
It does not matter. My Stable Diffusion folder sits on my D Drive.
 

lordbolton

Newbie
Sep 8, 2017
25
22
My stash is like 24gb worth images, oh goodness, I had to compress it with zpaq and send it to another hardrive with 8tb, which is nice, b.t.w I forgot to mention there's option in webui.sh called "--ckpt-dir="drive/models/stable-diffusion"" for models and "--lora-dir="drive/models/loras"" for your loras to set paths to a different locations and set up in webui-user.sh in command --arg section using a notepad editor.
 
Last edited:
  • Like
Reactions: Luncher

Guess_Who

Member
Mar 17, 2024
236
581
One more question from my side!

How can I place moles on certain parts of the body? It doesn't work always.....

Easy ones are like under the eye or the cheek or even under the mouth.

Areas:

-Lower breast
-Upper breast
-Arms
-Inner thigh
-On pussy <---gives me the biggest trouble

Like I want two moles on the labia majora, two close to each other on the upper left.

Thanks in advance
 

Luncher

Newbie
Jun 16, 2023
39
58
My stash is like 24gb worth images, oh goodness, I had to compress it with zpaq and send it to another hardrive with 8tb, which is nice, b.t.w I forgot to mention there's option in webui.sh called "--ckpt-dir="drive/models/stable-diffusion"" for models and "--lora-dir="drive/models/loras"" for your loras to set paths to a different locations and set up in webui-user.sh in command --arg section using a notepad editor.
I've never heard of Zpaq until now, TY for bringing it up! If you have 24gb of generated images, I presume you are saving them in PNG? If so, you could try compressing them with before archiving to save more space, if lossless compression is important to you.
Also just a little slipup, but Webui.sh is only for Linux, and Guess_Who appears to be using windows, so he should apply that argument to webui.bat instead.
One more question from my side!

How can I place moles on certain parts of the body? It doesn't work always.....

Easy ones are like under the eye or the cheek or even under the mouth.

Areas:

-Lower breast
-Upper breast
-Arms
-Inner thigh
-On pussy <---gives me the biggest trouble

Like I want two moles on the labia majora, two close to each other on the upper left.

Thanks in advance
Excuse me for answering this, but my preferred method is to use inpainting (in the image tab) to add in moles after generating the image. It generally gives more consistent results for small details and can be done anywhere in the image.
 

Psan2022

Newbie
Mar 8, 2022
94
138
One more question from my side!

How can I place moles on certain parts of the body? It doesn't work always.....

Easy ones are like under the eye or the cheek or even under the mouth.

Areas:

-Lower breast
-Upper breast
-Arms
-Inner thigh
-On pussy <---gives me the biggest trouble

Like I want two moles on the labia majora, two close to each other on the upper left.

Thanks in advance
As Luncher said, inpainting is a valid possible way.

1. Maybe the others have a better way (please share and/or correct me!), but I do it like this and it works for me.
For inpainting you click on the inpainting Button next to the generated image:
1734866153673.png
2. You are then automatically send to the img2img inpaint tab.
1734866229465.png
3.Here you can paint over the area you want to change. You may adjust the CFG scale and the Denoising Factor.
CFG Scale -> How important your prompt is
Denoising -> How much freedom you are giving Stable Diffusion.
Inpaint Area-> Only Masked
Set the Batch Count or Batch Size to generate more images (since you will need, it is basically a gatcha game from now on unitl you find a picture you like).
You can leave your prompt as is, or add the specific thing you want to have.

But I will be real with you. In my opinion Stable Diffusion isnt so good at inpainting small objects that are not there. It is much better in changing what is already there. So you can just draw a black dot where you want the mole to be and blend it in via inpainting. So you dont need to like regenerate 20 images until you find something you like. This works quite well with anime style images.

If you are generating more realistic images then I would just use Photoshop to spare me the hassle. There are a lot of tutorials how to add moles etc. for photoshop. 5 minutes and its done. IMHO
 
  • Like
Reactions: Guess_Who

Guess_Who

Member
Mar 17, 2024
236
581
I've never heard of Zpaq until now, TY for bringing it up! If you have 24gb of generated images, I presume you are saving them in PNG? If so, you could try compressing them with before archiving to save more space, if lossless compression is important to you.
Also just a little slipup, but Webui.sh is only for Linux, and Guess_Who appears to be using windows, so he should apply that argument to webui.bat instead.

Excuse me for answering this, but my preferred method is to use inpainting (in the image tab) to add in moles after generating the image. It generally gives more consistent results for small details and can be done anywhere in the image.
As Luncher said, inpainting is a valid possible way.

1. Maybe the others have a better way (please share and/or correct me!), but I do it like this and it works for me.
For inpainting you click on the inpainting Button next to the generated image:
View attachment 4362706
2. You are then automatically send to the img2img inpaint tab.
View attachment 4362709
3.Here you can paint over the area you want to change. You may adjust the CFG scale and the Denoising Factor.
CFG Scale -> How important your prompt is
Denoising -> How much freedom you are giving Stable Diffusion.
Inpaint Area-> Only Masked
Set the Batch Count or Batch Size to generate more images (since you will need, it is basically a gatcha game from now on unitl you find a picture you like).
You can leave your prompt as is, or add the specific thing you want to have.

But I will be real with you. In my opinion Stable Diffusion isnt so good at inpainting small objects that are not there. It is much better in changing what is already there. So you can just draw a black dot where you want the mole to be and blend it in via inpainting. So you dont need to like regenerate 20 images until you find something you like. This works quite well with anime style images.

If you are generating more realistic images then I would just use Photoshop to spare me the hassle. There are a lot of tutorials how to add moles etc. for photoshop. 5 minutes and its done. IMHO
Thanks for the explanation, I will try it out. If I run into problems again I'll be back for more questions.

No, I'm not generating realistic images. Only anime styled ones.
 

lordbolton

Newbie
Sep 8, 2017
25
22
I love this thing so much, it speeds up my high res fix image like 640x512 to 1920x1080 for few seconds without going into oom aka out of memory.
 

Psan2022

Newbie
Mar 8, 2022
94
138
where can you find, models based upon big bang theory, game of Throne??
Pretty much everything AI related is on Civitai.
If you want a more realistic "photographic" look I would pick a realistic base checkpoint like "Dreamshaper" or "AbsoluteReality" and then use a Lora for the characters. But that depends on what image you are aiming for.
Big Bang Theorie:
Game of Thrones:
 
Last edited:

lordbolton

Newbie
Sep 8, 2017
25
22
Face Swap with ADetailer and ReActor


and for expressions.

I copy this from a reddit thread.

Step 1: Generate your initial image and then move it to inpainting. My prompt was "woman"

Step 2: Select the area of the face you want to change such as the eyes or mouth.

Step 3: Set Inpainting mode to original and denoising to around 0.75

Step 4: Enable Reactor and set Restore Face to Codeformer. Set both Restore Face Visibility and CodeFormer weight to 1. Feel free to play with these value. Also use the originally generated image as your "replacement image".

Step 5: Prompt the change such as "smiling woman" and Generate.

I notice that ReActor has a option for face models, I find it bloody useful.
 
Last edited:

ultimtvp

Newbie
Oct 19, 2023
40
15
A question, is stablediffusion currently the best AI to generate this type of nsfw images? Do you know if there is any other AI with better results?
 

Psan2022

Newbie
Mar 8, 2022
94
138
A question, is stablediffusion currently the best AI to generate this type of nsfw images? Do you know if there is any other AI with better results?
Qood question. From all the text to image generators you can run locally I think Stable Diffusion is the most versitile and most used one. But ComfyUI is also very interesting.