Stable Diffusion Settings for generating erotic 2D AI illustrations

Stable Diffusion エッチな2次元AIイラスト生成のための設定

I have summarized the key settings for generating erotic 2D AI illustrations. Please note that the tool used is stable diffusion AUTOMATIC1111 Web UI.

Contents

Settings

The main items I set during image generation are as follows.

SamplerDPM++2M Karras
Sampling
steps
20
CFG Scale7
UpscaleHires.fix ON
Latent (nearest-exact)
Upscale by 2
resize: from 512x512 to 1024x1024
Denoising
strength
0.6
Clip skip2
Eta noise
seed delta
(ENSD)
31337

Sampler, Sampling steps, CFG Scale

After verifying various combinations, the above combination proved to have high processing speed and good quality impression.

About Aspect Ratio

I like square images with a 1:1 aspect ratio because they don't have any unfavorable compositions, although they may lack some impact.

Addition of upscaler

I've been seeing more people using upscalers that are not included by default.

One upscaler I recently came across is called 4x_fatal_Anime_500000_G.pth available at https://huggingface.co/Akumetsu971/SD_Anime_Futuristic_Armor/tree/main.

Personally, I think sticking with the Latent (nearest-exact) option is fine, but if you want to give it a try, you can place the 4x_fatal_Anime_500000_G.pth file inside stable-diffusion-webui/models/ESRGAN for it to be recognized.

Denoising strength

It is recommended to set it to 0.6 because lowering the value to 0.55 may introduce noise in the image.

Clip skip

When generating 2D images, it is often recommended to use a setting value of 2.

Why can't the same image be generated?

The possible main causes are the following three.

Possible main causes
  • The value of Eta noise seed delta (ENSD) is different
  • The value of Random number generator source. Changes seeds drastically. Use CPU to produce the same picture across different vidocard vendors. is different
  • The filename of LoRA is different

The value of "Eta noise seed delta" is different

Let's check the value of Eta noise seed delta in the Sampler parameters under the setting of the stable diffusion AUTOMATIC1111 Web UI.

Eta noise seed delta の設定

The default value here is 0, but setting it to 31337 is more popular. 31337 is a configuration value compatible with NovelAI. If it is currently set to 0, please try changing the setting value.

The value of "Random number generator source." is different

Let's check the value of Random number generator source. Changes seeds drastically. Use CPU to produce the same picture across different videocard vendors in the Stable Diffusion setting of stable diffusion AUTOMATIC1111 Web UI. This is a recently added setting, so it may not be available in older versions.

Random number generator source. Changes seeds drastically. Use CPU to produce the same picture across different vidocard vendors. の設定値

I don't remember which one was the default value, but there are differences in the generated images depending on whether it's GPU or CPU. I'm not sure which one is currently more popular.

The filename of LoRA is different

You need to input the prompt according to the filename in LoRA.
For example, if the file name is aaa-v1.safetensors in LoRA, you would enter <lora:aaa-v1:1>.

However, there are cases in which the images and prompts published on civitai have changed the file names for LoRA. In such cases, if you copy and use the prompt, there will be differences in the LoRA file names, and LoRA will not function properly.

This case is quite common, so make sure to double-check the LoRA file name and prompt.

Configuration of webui-user.bat

When generating images, there may be cases where the process stops due to insufficient memory or completely black images are generated. To avoid this problem, try modifying the webui-user.bat file as follows.

Please be careful not to mistake it for a similar named file called webui.bat.

@echo off

set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=--xformers --no-half-vae

call webui.bat

The important part is on line 6, where you should add the following line:
set COMMANDLINE_ARGS=--xformers --no-half-vae

--xformers option speeds up processing and reduces VRAM consumption.
--no-half-vae option prevents the generation of completely black images.

Contents