Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What does "supports multiple hypernetworks" mean? #26

Closed
ClashSAN opened this issue Jan 13, 2023 · 5 comments
Closed

What does "supports multiple hypernetworks" mean? #26

ClashSAN opened this issue Jan 13, 2023 · 5 comments

Comments

@ClashSAN
Copy link

hi @aria1th, in the wiki you say: "supports multiple hypernetworks." I'm not sure what it means, is it related to training/merging?

A second extension applies multiple hypernetworks on a picture when using: https://github.com/antis0007/sd-webui-multiple-hypernetworks

@bananasss00
Copy link

You can create a text file with hns extension and place it in the directory with your hypernetwork models. Can then be selected as a hyper model this file

Hns file is designed to use several models at the same time with different strength values.

Read more here:
AUTOMATIC1111/stable-diffusion-webui#4334

@aria1th
Copy link
Owner

aria1th commented Jan 13, 2023

Its very old feature, actually that extension was based on my patch.
image

You can create .hns file that defines order and mix ratio of hypernetworks. for example here, haibara_2177_1089 is .hns file that is created with notepad

[('haibara_mish-1089', 0.5), ('haibara_without_desc-2177', 0.5)]

This means you'll apply first hypernetwork with strength 0.5, then apply second hypernetwork with strength 0.5.

In mathematical representation,

R(x) = B(A(x, 0.5), 0.5)

To 'mix', weighted sum, you can define as this :

image

Here, haibara_ai_st is defined as

{'haibara_mish-1089': 4, ('Tamano_Kedama-gamma', 0.15): 1}

This means first hypernetwork will be applied with strength 1.
Second hypernetwork will be applied with strength 0.15.

Both result will be 'mixed' by weight 4:1.

In mathematical representation,

R(x) = {4*A(x, 1) + 1*B(x, 0.15) }/ 5

haibara_2177_1089.txt
haibara_ai_st.txt

You can just change .txt file to .hns file. That's all!

@ClashSAN
Copy link
Author

ClashSAN commented Jan 13, 2023

It seems like you mean for training.

  • allows processing multiple HN sequentially, or in parallel.
  • order and mix ratio of hypernetworks.

I want the users to clearly know the difference between this and the other one. The other one is used for inference, this is for training

@ClashSAN
Copy link
Author

Its very old feature, actually that extension was based on my patch.

A second extension applies multiple hypernetworks on a picture when using: https://github.com/antis0007/sd-webui-multiple-hypernetworks

now i re-read it again and it sounds like for inference.
anyhow, please.. if I'm wrong, edit the extension wiki and extensions index to say for inference, training, or both if that's what it is.

@aria1th
Copy link
Owner

aria1th commented Jan 13, 2023

Yes, its for inference. Actually training can somehow actually work with hns file, (although there is no proper 'save' function currently) without any problem, but I don't plan to really allow it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants