Hypernetwork Style Training, a tiny guide #2670
Replies: 72 comments 381 replies
-
I find that my hypernetworks are starting to cook on 5e-6 somewhere after ~17k steps, so that might be a good stopping point. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the guide! I find that hypernetworks work best to use after fine tuning or merging a model. Trying to train things that are too far out of domain seem to go haywire. It makes sense considering that when you fine tune a Stable Diffusion model, it will learn the concepts pretty well, but will be somewhat difficult to prompt engineer what you've trained on. Hypernetworks seem to help alleviate this issue. |
Beta Was this translation helpful? Give feedback.
-
A few more examples of NAI + Andreas Rocha hypernetwork now that it is trained. |
Beta Was this translation helpful? Give feedback.
-
Thanks for this guide I have been struggling to get an embedding of a particular atrists style sorted out and this helped no end to an acceptable result. I had 26 examples of the artists work which I manually resized/cropped to 512x512. Embeddings need a much bigger Learning rate, and after some trial and error, I ended up with: Initialization text: * Nice thing about the embeddings is I can use a standard model and just add "painting by [artist-name]" to my prompts. I will try extending the final learn out to a much bigger number of steps and see if more details appear. |
Beta Was this translation helpful? Give feedback.
-
can you share the post processed imgs that you used for the training? if its possible. Just to have a better idea of what works |
Beta Was this translation helpful? Give feedback.
-
Very good tutorial, although my VRAM currently doesn't support me to use Train XD |
Beta Was this translation helpful? Give feedback.
-
I trained a mob psycho Hypernetwork , here are the results with 26k steps No mob psycho prompts where use to generate these images. Some extras |
Beta Was this translation helpful? Give feedback.
-
I'm trying to train it on Mass Effect aliens. I know the SD 1.4/1.5 model has a vague idea of what they are, but training goes in circles. Is Hypernetwork the wrong tool for that? |
Beta Was this translation helpful? Give feedback.
-
Do you know where the default values for training are kept? I'd like to edit change the usual 0.005 to your recommended schedule. There's usually always one value I forget to set and I have to start all over. |
Beta Was this translation helpful? Give feedback.
-
For anyone wanting to test something, this is an annealing learning rate I'm trying out: It would be better if we could put math expressions in the learning rate field instead. |
Beta Was this translation helpful? Give feedback.
-
There is a PR for multilayer structure settings for hypernetworks #3086. Does anyone have an idea on this affects training? |
Beta Was this translation helpful? Give feedback.
-
What learning rate did you use?
fim., 20. okt. 2022 kl. 17:42 skrifaði Pirate Kitty <
***@***.***>:
… I've been able to train faster with normalization, but increasing the
neural network density only slowed training down without any perceivable
gain, at least on 100ish picture dataset.
—
Reply to this email directly, view it on GitHub
<#2670 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3XG2HZZR47QM2FXR3N7R2LWEGABLANCNFSM6AAAAAARFV5TAI>
.
You are receiving this because you commented.Message ID:
<AUTOMATIC1111/stable-diffusion-webui/repo-discussions/2670/comments/3927066
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
Yeah, my goal is good, not fast.
fim., 20. okt. 2022 kl. 19:43 skrifaði Pirate Kitty <
***@***.***>:
… I'm currently using 5e-3:200, 5e-4:400, 5e-5:1000, 5e-6:2000, 5e-7:3000
for normalized. Only training up to 3000 steps. But the results aren't good
and they don't seem to get better with normalized. So it's only if you want
something fast, I suppose.
—
Reply to this email directly, view it on GitHub
<#2670 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3XG2H2NL22VKOMDM6G22UDWEGOGJANCNFSM6AAAAAARFV5TAI>
.
You are receiving this because you commented.Message ID:
<AUTOMATIC1111/stable-diffusion-webui/repo-discussions/2670/comments/3927937
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Just a quick question on how to read "loss convergence". For example, a loss from "0.30-0.10" to "0.25-0.15", can be interpreted as converging? Am I understanding this correctly? |
Beta Was this translation helpful? Give feedback.
-
I can't get Hypernetwork training "to work". Training a model on myself via Dreambooth creats great results, but trying the same with Hypernetwork I look like a** 😂 Like a long lost cousin or something. I tried Hypernetwork on a friend of mine and no matter what I did he turned up a good lookin asian dude and he is not asian at all 😂 Lol... Wish I could use this training since 10GB VRAM is to little to train Dreambooth locally |
Beta Was this translation helpful? Give feedback.
-
So much has changed in the recent commits that I feel like most of the info in this thread is no longer relevant. Kinda feel like its time to start a new one with revised research and findings. |
Beta Was this translation helpful? Give feedback.
-
I tried training a hypernetwork on a character. So far, the best model was done with 20000 steps on 32 images and
|
-
The negative text preview during training appears to have been fixed a few patches ago, carry on.
tl;dr
Prep:
Training:
5e-5:100, 5e-6:1500, 5e-7:10000, 5e-8:20000
[filewords]
in it.Longer explanation:
Select good images, quality over quantity
My best trained model was done using 21 images. Keep in mind that hypernetwork style transfer is highly dependent on content. If you pick an artist that only does cityscapes and then ask the AI to generate a character with his style, it might not give the results you expect. The hypernetwork intercepts the words used during training, so if there are no words describing characters, it doesn't know what to do. It might work, might not.
Train in 512x512, anything else can add distortion
I've tested this several times. I haven't gotten good results out of it yet. So up to you.
Use BLIP and/or deepbooru to create labels AND Examine every label and remove whatever it wrong, add whatever is missing
It's tedious and might not be necessary, if you see blip and deepbooru are working well, you can let it as is. In any way, describing the images is important so the hypernetwork knows what it is trying to change to be more like the training image.
Learning Rate:
5e-5:100, 5e-6:1500, 5e-7:10000, 5e-8:20000
They added a training scheduler a couple days ago. I've seen people recommending training fast and this and that. Well, this kind of does that. This schedule is quite safe to use. I haven't had a single model go bad yet at these rates and if you let it go to 20000 it captures the finer details of the art/style.
Prompt Template: a .txt with only
[filewords]
in it.If your blip/booru labels are correct, this is all you need. You might want to use the regular hypernetwork txt file if you want to remove photo/art/etc bias from the model you're using. Up to you.
Steps: 20000 or less should be enough.
I'd say it's usable in the 5000-10000 range with my learning rate schedule up there. Buuut you will notice that in the 10000-20000 range, a lot of the finer details will show up. So as the rock would say, put in the work, put in the hours.
Final notes after the rock intermission.
Examples:
Trained NAI for 6500 steps on Andreas Rocha style. I plan on letting it train to 20000 later. And done.
Vanilla NAI
RTX On, I mean, Style on
20000 steps
Vanilla NAI
Rocha ON
20000 Steps
Beta Was this translation helpful? Give feedback.
All reactions