AI Painting Stable Diffusion Research (16) SD Hypernetwork Detailed Explanation


Hello everyone, I am rain or shine.


Contents of this issue:

  • What is a Hypernetwork?
  • What differentiates Hypernetwork from other models?
  • Principle of Hypernetwork
  • How to download and install Hypernetwork?
  • How to use Hypernetwork?

In the previous article, we introduced in detail the definition, function, and how to install and use embedding. I believe friends who have read it know that embedding is a model fine-tuning technology that packs prompt words. Interested friends, you can go to check: AI Painting Stable Diffusion Research (15) SD Embedding Detailed Explanation .


In fact, the Hypernetwork and embedding we will talk about today are even the same as the Lora model we will introduce later, and they are also a model fine-tuning technology.


Hypernetwork is actually not a key knowledge we introduced, we only need to understand the principle and usage of this fine-tuning technology!


Mainly for the following reasons:

  • Hypernetwork is a model fine-tuning technology earlier than Lora, and now fewer and fewer people are using it.

    We screened Hypernetwork at station c , and there were only 33 Hypernetwork files.

insert image description here


  • The use effect of Hypernetwork is not ideal, and it is not even as good as the embeddings file with a volume of only a few kilobytes, but the file volume of Hypernetwork can be compared with lora, in tens of M or even hundreds of M.

insert image description here


  • Almost all the effects that Hypernetwork can achieve can be achieved with other alternatives, such as embeddings or lora.

1. What is Hypernetwork?

Hypernetwork Chinese name (超级网络), originally developed by stable diffusion early adopter NovelAI, is a small neural network attached to a stable diffusion model to modify its style.


2. The difference between Hypernetwork and other models

  • Hypernetwork VS Checkpoint (big model)

Checkpoint models contain all the necessary information to generate images, we can recognize them by their file size, they range from 2 GB to 7 GB for Checkpoint and usually below 200 MB for Hypernetwork.

​ Hypernetwork cannot be used alone, it needs to cooperate with the checkpoint model to generate images.


  • Hypernetwork VS LoRA model

    Hypernetwork is very similar to the LoRA model, and their file size is similar, usually below 200MB, which is smaller than the checkpoint model.

    There is a fact: the LoRA model works better than the Hypernetwork model.


  • Hypernetwork VS Embeddings

    Embeddings is a fine-tuning method called Textual Inversion, which simply defines new keywords to achieve certain styles. As with HypernetworkEmbeddings, it does not change the model Embeddings and Hypernetwork apply to different parts of the stable diffusion model.

    Embeddings create new embeddings in the text encoder.

    Hypernetwork inserts a small network into the cross-attention module of the noise predictor.


3. Download and install Hypernetwork

​ Here we take the example of downloading the Hypernetwork model from station c as an example.


​The first step, open station c in the browser and search for Hypernetwork

insert image description here


The second step is to choose the Hypernetwork model you like and download it

We are here to download this Hypernetwork model demonstration, as follows:

insert image description here


The download is complete, and the waterElemental_10.pt file is obtained


The third step is to copy this model file to the \sd-webui-aki-v4.2\models\hypernetworks directory

\sd-webui-aki-v4.2\models\hypernetworks

insert image description here

Restart stable diffusion for it to take effect.


4. The use of Hypernetwork

The usage of Hypernetwork is similar to that of Embeddings, the difference is that Hypernetwork is used in forward prompts, while Embeddings is used in reverse prompts.


The Hypernetwork model used by our button is:

Water Elemental

Water Elemental is a unique hypernetwork that can turn anything into water!

Use the phrase water elementa" before the topic to use this hypernetwork with Stable Diffusion v1.5, changing the hypernetwork weights to tune the water effect.


(1), set positive prompt words

water elemental woman walking across a busy street 

(2) Select the Water Elemental Hypernetwork model
insert image description here


After selecting the Water Elemental Hypernetwork model, it will be automatically added in the positive prompt words:

insert image description here


(3), setting parameters

  • Sampling algorithm: DPM++2M Karras
  • Number of iteration steps: 15
  • CFG Scale: 7

insert image description here


(4) Click the button, the effect is as follows:

insert image description here


Well, that’s all for today’s content, and we will continue to share dry goods about Stable Diffusion later. If you like it, please follow me. See you next time.


Guess you like

Origin blog.csdn.net/lizhong2008/article/details/132508540