[Stable Diffusion]Using embeddings

This article can be read in about 5 minutes.
PR

The purpose


I will add and use an embedding in a locally running Stable Diffusion web UI. Using an embedding can improve the quality of the generated images.

This might sound similar to a VAE, but embeddings have a greater impact on the generated images. You can think of a VAE as applying a filter to an already generated image to enhance its quality, whereas an embedding is more about generating a similar, high-quality image from the start.

For more on VAEs, please refer to the following article.

PR

Environment

stable-diffusion-webui-forge


(The same method for installing embeddings can be used for other Stable Diffusion web UIs.)

PR

Download VAE

n this article, I will use veryBadImageNegative as an example.

Download


veryBadImageNegative can be downloaded from the following page.

veryBadImageNegative - veryBadImageNegative_v1.3 | Stable Diffusion Embedding | Civitai
v1.3 veryBadImageNegative_v1.3使用了新的训练图集,在AOM3和 viewer-mix_v1.7 中使用时表现较好。 veryBadImageNegative_v1.3 uses a new training atlas and performs well when...
PR

Install embedding


Copy the downloaded file to the following folder.

Install Folder\embeddings

Depending on your Stable Diffusion installation method, you might not have a webui folder. In that case, the path might be installation_folder\embeddings.

PR

Image Generation Using an Embedding


If the string appears in the Negative Prompt field, you’re all set.

Open the Textual Inversion tab.

Click on the Negative Prompt input field.

Click on verybadimagenegative_v1.3 within the Textual Inversion tab.


Now, you can enter the rest of your Prompts/Negative Prompts as usual and click Generate to create your image.

Others: How to input


You can enter the string for the Negative Prompt (verybadimagenegative_v1.3) either directly or by using a template; both methods work fine.

PR

Result


I was able to add and use an embedding in the Stable Diffusion web UI.

I’ve included an example below.

As noted in the goal, unlike a VAE, using an embedding generates different images while keeping the overall concept.


Without embedding

With embedding

Appendix


The correct way to use the embedding is to enter the specified string in the Negative Prompt, but it will still function even if you put it in the Prompt.

If you put it in the Prompt, it will generate strange, garbled images. If the app doesn’t work as intended, please check that the input location is correct.

PR

Other embedding


Here are some download pages for other embeddings besides verybadimagenegative_v1.3.

EasyNegative

gsdf/EasyNegative at main
We’re on a journey to advance and democratize artificial intelligence through open source and open science.

bad-hands-5

for hand/finger

yesyeahvh/bad-hands-5 at main
We’re on a journey to advance and democratize artificial intelligence through open source and open science.

comment

Copied title and URL